<?php
if ($_POST['formsent'] == "1")
{
$email = $_POST['email'];
$subject = $_POST['subject'];
$youremail = $_POST['replyto'];
$message = $_POST['message'];
if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email))
{
echo "The e-mail was not valid. Please go back and try again.";
}
else
{
if($subject == "")
{
echo "You must enter a email subject";
}
else
{
if(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $youremail))
{
echo "Your e-mail was not valid. Please go back and try again.";
}
else
{
if($_POST["url"] != "")
{
exit;
}
else
{
if ($message == "")
{
echo "You must enter a message";
}
else
{
$headers = "From: ".$youremail;
mail($email,$subject,$message,$headers);
echo "
Thank you for filling out the online form. I will get back to you very soon.
";
}
}
}
}
}
}
else
{
?>
If you need to contact me please use the online form below and I will get back to you as soon as possible.
<br /><br >
<hr />
<br />
<form action="contact.php" method="post">
<table width="520px" align="left" cellpadding="0" cellspacing="10" class="txt" style="border: 0px">
<input type="hidden" name="formsent" value="1" />
<input type="hidden" name="email" value="email address here" />
<tr>
<td align="left" valign="middle" width="115px"><b>Name :</b></td>
<td width="400px"><input type="text" name="subject" value="" /></td>
</tr>
<tr>
<td align="left" valign="middle" width="115px"><b>Email Address :</b></td>
<td width="400px"><input type="text" name="replyto" value="" /></td>
</tr>
<tr>
<td align="left" valign="top" width="115px"><b>Message :</b></td>
<td width="400px"><textarea cols="30" rows="10" name="message"></textarea></td>
</tr>
<tr>
<td align="left" valign="middle" width="115px"><input type="hidden" value="url" /></td>
<td width="400px"><input type="submit" value="Send Email" /><input type="reset" value="Reset" /></td>
</tr>
</table>
</form>
<?php
}
?>