<p>
<center>
<?php
if (isset($submit)) {
$name = $_POST['name'];
$email = $_POST['email'];
$find = $_POST['find'];
$message = $_POST['message'];
if (empty($name)) $error[]="You did not fill out your name, please go back and correct this!";
if (empty($email)) $error[]="You did not fill out your valid email address, please go back and correct this!";
if (empty($message)) $error[]="You did not fill out your message, please go back and correct this!";
if (isset($error)==false)
{
$to = "admin@pestirc.com";
$subject = "Question from a user";
$msg = "Name: $name\nEmail: $email\nSubject: $find\n\nMessage:\n $message";
mail($to,$subject,$msg, "From: $email");
echo "<br><p><br>";
echo "Thank you for contacting PestIrc.Com - We will shortly <br />";
echo "reply to your message.";
} else foreach ($error as $msg) echo $msg.'<br />';
} else {
echo "Have a question about the site or staff? Ask away and get a reponse soon. <br><b>Note: For our staff to reply to your questions, you need to enter a valid email address.</b><p>";
echo "<form method=\"post\" action=\"$PHP_SELF\">";
echo "<p>Your name:";
echo " <input type=\"text\" name=\"name\" size=\"40\" />";
echo "<p>Your e-Mail:";
echo " <input type=\"text\" name=\"email\" size=\"40\" />";
echo "<p>Subject of question:";
echo " <input type=\"text\" name=\"find\" size=\"40\" />";
echo "<p>Your message: <br /> </p>";
echo "<p><textarea cols=\"50\" rows=\"10\" name=\"message\"></textarea></p>";
echo "<p><input type=\"submit\" name=\"submit\" value=\"Submit\" />";
echo "</form>";
}
?>