Forum Moderators: coopster

Message Too Old, No Replies

Form fill & print

         

askeli

7:14 pm on Aug 6, 2004 (gmt 0)

10+ Year Member



Hi im trying to create a simple form that visitors will complete name address phone email and quantity, i dont need the form sent anywhere just a confirmation page that the visitor will print and post. its just to place an order for one item i will sell.

I see so many PHP forms but they seem way to advanced for my simple needs. can someone point me in the right direction.

Many Thanks for any help

httpwebwitch

7:40 pm on Aug 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



welcome to WebmasterWorld!

on the first page, create the HTML form:

[form.php]
<form action="process.php" method="POST">
<input type="text" name="phone" value="">
<input type="text" name="email" value="">
.. add your other fields here
</form>

Then on the next page, retrieve the form values from the $_POST array.

[process.php]
<?php
print("<BR>Phone number: ".$_POST['phone']);
print("<BR>Email Address: ".$_POST['email']);
?>

Some folks (myself included) like to put the processing script in the same file as the form. It complicates things only slightly, but for simplicity the method above does the job just fine.

It seems strange to me that people will fill out a web form and then have to print it out and send it by postal mail. What's the point of having it on the web, if it's not making use of electronic communication? Personally, I'd be annoyed, because I don't usually keep a stash of postage stamps on hand.

Be that as it may, that's how you submit a form and see the results formatted nicely on the next page.

Birdman

7:54 pm on Aug 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It seems strange to me that people will fill out a web form and then have to print it out and send it by postal mail. What's the point of having it on the web, if it's not making use of electronic communication?

If that's the ONLY way to purchase then it's liable to lose potential sales.

However, if your are adding it as ANOTHER way to purchase, it's likely to increase sales. I added a printable order form on a site recently and was surprised when two orders came in within days.

Birdman

askeli

8:28 pm on Aug 6, 2004 (gmt 0)

10+ Year Member



Thanks for the script,

The person i am selling for wont accept any online payments, so if they have to send a cheque they might aswell send the the order, lousy idea i know but its beyond my control.

Thanks again

askeli

8:37 pm on Aug 6, 2004 (gmt 0)

10+ Year Member



the script is working just fine thanks,

is there any way i can work out the total price? ie the price multiplied by the quantity and display the results?

Many Thanks

Birdman

8:41 pm on Aug 6, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Just do some PHP math:

$total = $_POST["amount"] * $_POST["cost"];

Then print() it where needed.