Hello,
Thanks a lot for your replies.
Actually my form works like this:
1. HTML Form: order.htm
When submitted, it calls send.php to process it.
2. PHP Form processor Code: send.php
It processes the form in order.htm and sends the form details to the email and then displays confirmation page i.e. thanks.php
3. Confirmation Page: thanks.php
In this I am looking to fetch details of form submitted. The fileds would be Name etc.
Below is the code of all the above files one by one
CODE FOR ORDER.HTM
Code:
<html>
<head>
<title>
Order Form
</title>
</head>
<body>
<form method="post" action="send.php" name="form1">
<u><b>PRODUCT DETAILS: </b></u>
</br>
</br>
<input type="text" name="nameofproduct" size="45" readonly value="PRODUCT NAME">
</br>
</br>
<b>Price in USD: </b>
<input type="text" name="priceusd" size="5" value="1" readonly>
</br>
</br>
</br>
</br>
<b><u>CONTACT DETAILS</b></u>
</br>
</br>
<b>Title: </b>
<select name="nametitle">
<option selected value="Mr.">Mr.</option>
<option value="Ms.">Ms.</option>
</select>
</br>
</br>
<b>Full Name: </b>
<input type="text" name="name" size="35">
</br>
</br>
<b>Address: </b>
<textarea rows="5" name="address" size="30" cols="35"></textarea>
</br>
</br>
</br>
</br>
<b><u>Details about City, District, State, Country, PIN/ZIP Code</b></u>
</br>
</br>
<b>City: </b>
<input name="city" size="23">
</br>
</br>
<b>District: </b>
<input name="district" size="23">
</br>
</br>
<b>State: </b>
<input name="state" size="23">
</br>
</br>
<b>Country: </b>
<input name="country" size="23">
</br>
</br>
<b>PIN/ZIP Code: </b>
<input name="pincode" size="23">
</br>
</br>
<b>Telephone: </b>
<input name="telephone" size="35">
</br>
</br>
<b>E-mail: </b>
<input name="email" size="35">
</br>
</br>
<b>Any other information/query: </b>
<textarea rows="5" name="query" size="30" cols="35"></textarea>
</br>
</br>
<input type="submit" value="Submit">
</form>
</body>
</html>
CODE FOR THANKS.PHP
Code:
<html>
<head>
<title>
Thanks for your order
</title>
</head>
<body>
Dear <?php echo $_Request['nametitle'] ?> <?php echo $_Request['name'] ?>
</br></br>
THANKS FOR YOUR ORDER.
WE WILL GET BACK TO YOU SOON
</body>
</html>
Actually I am not aware of the syntax to use in send.php. But I know that in ASP we write e.g. session("name")= name to create a session variable and store the value of form field in it and then we can fetch it using <%=session("productname")%>.
Hope someone can guide me to a very basic thing in PHP.
Bookmarks