PDA

View Full Version : How to send form information to email address



fredyombo
30 May 2006, 07:13 AM
Hi Iam doing a site for a friend the site is www.loveforafricasafris .co.ke . The booking form calls php file with codes below.

<?php

reset ($HTTP_POST_VARS);
$body = "<p>The following is Feedback from your website</p>";

while (list ($key, $val) = each ($HTTP_POST_VARS))
{
if ($val == "Submit")
{}
else {

$body.="<b>".$key."</b> \t \t ".$val."<br>";
if ($key == "emailaddress")
{$Email = $val;}
}
}
$xHeaders = "From: ".$Email."\nX-Mailer: PHP/" . phpversion();
$xHeaders .= "\nContent-type: text/html;charset=iso-8859-1\n";

mail("penfre@kenyaweb.com","booking form",$body,$xHeaders);
// or redirect
header("Location:thanksbooking.html");
?>



The Form goes but I dont recieve anything on my side. What am I doing wrong or not doing that I need to do.

See the form code below.



<table width="100%" height="399" border="1" bordercolor="#99CC99">
<tr>
<td height="13">
<p align="center"><b><i><font face="Verdana, Arial, Helvetica, sans-serif" color="#000066" size="2">Fill
in the Form below and submit to us. we shall process your safari,
then get back to you immediately.</font></i></b></p>
</td>
</tr>
<tr>
<td background="Images/Tigerback.gif" height="355">
<FORM ACTION="will.php" METHOD="POST" name="Bookings">
<CENTER>
<BR>
<table width="96%" height="251" align="center">
<tr>
<td width="28%" height="28">
<div align="right"><b>Surname:</b></div> </td>
<td width="72%" height="28">
<input type="text" name="Surname" size="35" maxlength="35">
<font color="#FF0000">*</font> </td>
</tr>
<tr>
<td width="28%" height="24">
<div align="right"><b>Second Name:</b></div> </td>
<td width="72%">
<input type="text" name="Secondname" size="35" maxlength="35">
<font color="#FF0000">*</font> </td>
</tr>
<tr>
<td width="28%" height="53">
<div align="right"><b>Brief Comment:</b></div> </td>
<td width="72%" height="53">
<textarea name="briefcomment" cols="40" rows="3"></textarea> </td>
</tr>
<tr>
<td colspan="2" height="4">
<div align="left"><b><font color="#990000" size="3"><i>NEXT
OF KINS DETAILS</i></font></b></div> </td>
</tr>
<tr>
<td width="28%" height="24">
<div align="right"><b>Names ( in full):</b></div> </td>
<td width="72%">
<input type="text" name="NextofKinname" size="40" maxlength="50">
<font color="#FF0000">*</font> </td>
</tr>
<tr>
<td width="28%" height="33">
<div align="right"><b>Home Tel. No.:</b></div> </td>
<td width="72%" height="33">
<input type="text" name="hometel" size="30" maxlength="40">
<b><font color="#FF0000">*</font> <font size="2">(Include
country/area code</font>)</b> </td>
</tr>
<tr>
<td width="28%" height="24">
<div align="right"><b>Work Tel. No.:</b></div> </td>
<td width="72%">
<input type="text" name="Worktel" size="30" maxlength="38">
<font color="#FF0000">*</font> <b><font size="2">(Include
country/area code)</font></b></td>
</tr>
<tr>
<td width="28%" height="24">
<div align="right"><b>Email Address:</b></div> </td>
<td width="72%">
<input type="text" name="Emailaddress" size="35" maxlength="50">
<font color="#FF0000">*</font> </td>
</tr>
</table>
<P><INPUT NAME="submitform" TYPE="submit" VALUE="Submit">
<input type=RESET value="Reset Form" name="RESET">
</CENTER>
&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</FORM></td>
</tr>
</table>