Thread: form to email
View Single Post
03-12-2007, 01:43 PM
#4
ali.black is offline ali.black
Status: I'm new around here
Join date: Feb 2007
Location:
Expertise:
Software:
 
Posts: 13
iTrader: 0 / 0%
 

ali.black is on a distinguished road

  Old

here is the form:

<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<form name="form1" method="post" action="mail2.php">
<tr>
<td height="19" colspan="2" valign="top" nowrap><strong>
<LABEL for="name">Establishments Name</LABEL>
</strong></td>
<td width="6" valign="top">:</td>
<td colspan="4" rowspan="2" valign="top"><input name="name" type="text" id="subject" size="50"></td>
</tr>
<tr>
<td width="147" height="3"></td>
<td width="8"></td>
<td></td>
</tr>
<tr>
<td height="19"></td>
<td></td>
<td></td>
<td width="42"></td>
<td width="26"></td>
<td width="48"></td>
<td width="184"></td>
</tr>
<tr>
<td height="22" colspan="2" valign="top" nowrap>Your Contact Name </td>
<td valign="top">:</td>
<td colspan="4" valign="top"><input name="owner" type="text" id="subject2" size="50"></td>
</tr>

<tr>
<td height="35"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>

<tr>
<td height="22" colspan="2" valign="top" nowrap>Telephone Number </td>
<td valign="top">:</td>
<td colspan="4" valign="top"><input name="telephone" type="text" id="subject3" size="50"></td>
</tr>
<tr>
<td height="19"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>

<tr>
<td height="22" colspan="2" valign="top" nowrap>Address Line 1 </td>
<td valign="top">:</td>
<td colspan="4" valign="top"><input name="addressline1" type="text" id="subject4" size="50"></td>
</tr>
<tr>
<td height="19">&nbsp;</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="22" colspan="2" valign="top" nowrap>Address Line 2 </td>
<td valign="top">:</td>
<td colspan="4" valign="top"><input name="addressline2" type="text" id="subject5" size="50"></td>
</tr>
<tr>
<td height="19">&nbsp;</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="22" colspan="2" valign="top" nowrap>Town/City</td>
<td valign="top">:</td>
<td colspan="4" valign="top"><input name="town" type="text" id="subject6" size="50"></td>
</tr>
<tr>
<td height="19">&nbsp;</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="22" colspan="2" valign="top" nowrap>County</td>
<td valign="top">:</td>
<td colspan="4" valign="top"><input name="county" type="text" id="subject7" size="50"></td>
</tr>
<tr>
<td height="19">&nbsp;</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td height="22" colspan="2" valign="top" nowrap>Postcode </td>
<td valign="top">:</td>
<td colspan="4" valign="top"><input name="postcode" type="text" id="subject8" size="50"></td>
</tr>
<tr>
<td height="17"></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td colspan="2" rowspan="2" valign="top" nowrap><p>Information about your<br> establishment<br> i.e. Delivery,<br> special offers etc. </p></td>
<td height="21" valign="top">:</td>
<td colspan="4" rowspan="2" valign="top">

<textarea name="info" cols="47" rows="5" ></textarea> </td>
</tr>
<tr>
<td height="62">&nbsp;</td>
</tr>

<tr>
<td height="22"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="24"></td>
<td colspan="3" valign="top"><label>
<input type="submit" name="Submit" value="Submit">
</label>
<label></label></td>
<td>&nbsp;</td>
<td valign="top"><input type="reset" name="Submit2" value="Reset"></td>
<td>&nbsp;</td>
</tr>
<tr>
<td height="31"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</form>
</table>

Here is the php:

<?
$name=$_POST['name'];
$owner=$_POST['owner'];
$telephone=$_POST['telephone'];
$addressline1=$_POST['addressline1'];
$addressline2=$_POST['addressline2'];
$town=$_POST['town'];
$county=$_POST['county'];
$postcode=$_POST['postcode'];
$info=$_POST['info'];
$to="ali_b71@hotmail.co.uk";
$message="Restraunts Name: $name \n owner: \"$owner\"\n address line 1: $addressline1 \n address line 2: $addressline2 \n Town: $town \n county: $county \n Postcode: $postcode \n About their restraunt: $info";
if(mail($to,"restraunt $name",$message,"From: $name\n")) {
echo "Thanks!";
} else { echo "There was a problem sending your comments. Please check that you filled in the form correctly."; }
?>


and i want to put tick boxes in the form.

Cheers