this the complte code
<html>
<head>
<title>sample mail</title>
<?php
$recipientname = "Webmaster";
$recipientemail = "elmo03ph@yahoo.com";
$subject = "Online-Form Response for $recipientname";
$autoresponse = "yes";
$autosubject = "Thank you for Shopping @ E-ShopOnline.Com!";
$automessage = "This is an auto response from E-ShopOnline.com to let you know that we've successfully received your email sent through our email form. Thanks!
Thank You for Shopping!!!
Your Information:
First Name: $firstname
Last Name: $lastname
Address: $address
City: $city
Country: $country
Email: $email
---------------------------
Your Shopping Cart
Product List: $pname
Grand Total Price:$$totalamount
";
$thanks = "Thank you for shopping.<br>Please note that, for all ground deliveries, you must be present to sign for, and inspect, your order. <br/>E-ShopOnline.com offers delivery within 48hrs in any country.
Delivery to other planet is not available at this time<br>";
?>
<style type="text/css"><!--
td,body,input,textarea {
font-size:12px;
font-family:Verdana,Arial,Helvetica,sans-serif;
color:#000000}
--></style>
</head>
<body>
<?
require("dbase.php");
$db = @connect($hostname, $dbuser, $dbpass, $dbname);
echo "ako c eli";
$result = mysql_query("select * from elicart where ip='$ip1' and id='$id' ") or die (mysql_error());
if (isset($id)=='$row["1"]')
{
echo $row['1'];
}
?>
<?
$db = @connect($hostname, $dbuser, $dbpass, $dbname);
$ip1=$_SERVER['REMOTE_ADDR'];
$result = mysql_query("select * from elicart where ip='$ip1' ") or die (mysql_error());
if (!$result) {
echo "Could not successfully run query ($db) from DB: " ;
exit;
}
if (mysql_num_rows($result) == 0) {
echo "No rows found, nothing to print so am exiting";
echo "<br/><font color=red><b>'Empty Shoppping Cart'</b></font> <a href=main.php>click here to add</a>";
exit;
}
?>
<table cellspacing="2" cellpadding="2" border="0" >
<tr><td colspan="4"><h2>Your Shopping Cart</h2></td></tr>
<tr>
<td bgcolor="red"><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Qty</strong></font></td>
<td bgcolor="red"><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Product</strong></font></td>
<td bgcolor="red"><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Category</strong></font></td>
<td bgcolor="red"><font color="#FFFFFF" size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Price</strong></font></td>
</tr>
<?
while ($row = mysql_fetch_assoc($result))
{
echo "<tr>";
echo "<td width=20><font face=verdana size=1><strong>";
echo $row["qty"];
echo "</strong></font></td>";
echo "<td width=250><font face=verdana size=1>";
echo $row["name"];
echo "</font></td>";
echo "<td width=100><font face=verdana size=1>";
echo $row["category"];
echo "</font></td>";
?>
<td width="118"><font face=verdana size="1">
$<?php echo $row["price"]; ?>
<?
echo "</font></td>";
?>
<?
echo "</td></tr>";
$sum += $row[price];
$totalamount=$sum;
}
?>
<tr>
<td> </td>
<td width=224 ></td>
<td width=118 align="right"><font size="1" face="Verdana, Arial, Helvetica, sans-serif"><strong>Total</strong></font></td>
<td width=118><strong><font face=verdana, arial, helvetica, san-serif size=2></b>$<? echo "$totalamount"; ?> </font></strong></td>
</tr>
<table width="100%" height="100%"><tr>
<td valign="top"><font face="Verdana,Arial,Helvetica" size="2">
<?php
if($submitform) {
$firstname = $HTTP_POST_VARS['firstname'];
$lastname = $HTTP_POST_VARS['lastname'];
$address = $HTTP_POST_VARS['address'];
$city = $HTTP_POST_VARS['city'];
$country = $HTTP_POST_VARS['country'];
$email = $HTTP_POST_VARS['email'];
// check required fields
$dcheck = explode(",",$require);
while(list($check) = each($dcheck)) {
if(!$$dcheck[$check]) {
$error .= "Missing $dcheck[$check]<br>";
}
}
// check email address
if ((!ereg(".+\@.+\..+", $email)) || (!ereg("^[a-zA-Z0-9_@.-]+$", $email))){
$error .= "Invalid email address<br>";}
// display errors
if($error) {
?>
<b>Error</b><br>
<?php echo $error; ?><br>
<a href="#" onClick="history.go(-1)">try again</a>
<?php
}
else
{
$browser = $HTTP_USER_AGENT;
$ip = $REMOTE_ADDR;
// format message
$message = "Online-Form Response for $recipientname:
First Name: $firstname
Last Name: $lastname
Address: $address
City: $city
Country: $country
Email: $email
-----------------------------
Browser: $browser
User IP: $ip";
// send mail and print success message
$hurrah = mail($toemail,"$subject","$message","From: $firstname <$email>");
if($hurrah) {
if($autoresponse == "yes") {
$autosubject = stripslashes($autosubject);
$automessage = stripslashes($automessage);
mail($email,"$autosubject","$automessage","From: $recipientname <$recipientemail>");
}
echo "$thanks";
echo "<a href=main.php>Home</a>";
}
}
}
else {
?>
<form name="contactform" action="<?php echo $PHP_SELF; ?>" method="post">
<input type="hidden" name="toemail" value="<?php echo $recipientemail; ?>">
<input type="hidden" name="toname" value="<?php echo $recipientname; ?>">
<input type="hidden" name="require" value="firstname,lastname,address,city,country,email">
<table><tr>
<td colspan="2" align="center"><b><font size="2" face="Verdana,Arial,Helvetica">Customer
Information</font></b><br/>(Billing and Delivery Address)
<p></td>
</tr><tr>
<td valign="top" align="right">First Name:</td>
<td valign="top"><input name="firstname" size="25"></td>
</tr>
<tr>
<td valign="top" align="right">Last Name:</td>
<td valign="top"><input name="lastname" size="25"></td>
</tr>
<input type="hidden" name="totalamount" value="<? echo "$totalamount"; ?> " size="25">
<input type="hidden" name="pname" value="<? echo $row["name"]; ?> " size="25">
<tr>
<td valign="top" align="right">Address:</td>
<td valign="top"><input name="address" size="25"></td>
</tr>
<tr>
<td valign="top" align="right">City:</td>
<td valign="top"><input name="city" size="25"></td>
</tr>
<tr>
<td valign="top" align="right">Country</td>
<td valign="top"><input name="country" size="25"></td>
</tr><tr>
<td valign="top" align="right">E-mail:</td>
<td valign="top"><input name="email" size="25"></td>
</tr><tr>
<td colspan="2" align="center"><input type="submit" value="Submit" name="submitform">
<input type="reset" value="Reset" name="reset"></td>
</tr></table>
<br>
</form>
<?php } ?>
</font><p></td>
</tr></table>
</body>
</html>
this code suppose to be will email me and customer the product that he bought. this code is running . but i dnt know how to declare variable for each name display.?