Contact Us Form
Change "xxxxx@xxxxx.xxx" to your e-mail address and save this script as "contact.php".
This script will send comments from "Contact Us" form on your website to your e-mail address.
<?php
$status="Contact Us :";
$mymail = "xxxxx@xxxxx.xxx";
$test=$HTTP_POST_VARS["ftest"];
$subject=$HTTP_POST_VARS["fname"];
$name=$HTTP_POST_VARS["fname"];
$mail=$HTTP_POST_VARS["fmail"];
$comment=$HTTP_POST_VARS["fcomment"];
$subject="Contact from : $subject";
$body="Name : ".$name;
$body=$body."\nE-Mail :".$mail;
$body=$body."\n\n".$comment;
if($test=="1") {
if(mail($mymail,$subject,$body)) {
$status="Thank you for contacting us !"; }
else {
$status="Error !"; }}
?>
Save this under any html page name
<html><head>
<title>Contact Us Form</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head><body>
<form name="form1" method="post" action="contact.php">
<table width="75%" border="0" cellpadding="4" cellspacing="0" bgcolor="#EEEEEE">
<tr>
<td width="30%"> </td>
<td width="70%"><?php print $status; ?></td>
</tr><tr>
<td width="30%"><div align="right">Name : </div></td>
<td width="70%"><input name="fname" type="text" id="fname"></td>
</tr><tr>
<td width="30%"><div align="right">E-Mail : </div></td>
<td width="70%"><input name="fmail" type="text" id="fmail"></td>
</tr><tr>
<td width="30%"><div align="right">Comment : </div></td>
<td width="70%"><textarea name="fcomment" id="fcomment"></textarea></td>
</tr><tr>
<td width="30%"> </td>
<td width="70%"><input type="submit" name="Submit" value="Submit">
<input name="ftest" type="hidden" id="ftest" value="1"></td>
</tr>
</table>
</form>
</body></html>