<? require('vars.php'); ?>
<html>
<head>
<title><? echo "Contact $site_name"; ?></title>
<!--
phpsitemail v2.0 ©2003 http://netcode.net
you are free to use this script however you like aslong as this notice remains intact.
-->
</head>
<body>
<p> </p>
<?
if ($style == 1) {
echo "<link href=\"contact_style.css\" type=\"text/css\" rel=\"stylesheet\">";
}
function docheck( $email )
{
if (eregi("^[0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-z]{2,4}$", $email, $valid))
{
if (getmxrr( substr(strstr($valid[0], '@'), 1),$mxhosts))
{
return true;
}
}
return false;
}
if ($submit) {
if ($name == "") {
$error = "Please fill out your name";
}
else if ($email == "") {
$error = "Please enter your email address.";
}
else if (!docheck($email)) {
$error = "The format of your email doesn't appear to be valid";
}
else if ($message == "") {
$error = "Please enter a message";
}
if ($error) {
echo "<table align='center' width='380' cellspacing='0' cellpadding='10'>";
echo "<tr><td align='center'>";
echo "<font color='#C00020'>$error</font><br><br><a href='javascript:history.go(-1)'>< click to continue ></a>";
echo "</td></tr></table>";
}
else {
@extract($_POST);
$name = stripslashes($name);
$email = stripslashes($email);
$subject = stripslashes($subject);
$message = stripslashes($message);
$message = "$message\n\nAim: $aim\nMsn: $msn";
mail($to,$subject,$message,"From: $name <$email : $ip>");
echo "<table align='center' width='380' cellspacing='0' cellpadding='10'>";
echo "<tr><td align='center'>";
echo "Thankyou $name, your mail's been sent<br><br>click <a class=\"red\" href=\"$site_addr\">here</a> to return to $site_name";
echo "</td></tr></table>";
}
}
?>
<form name="contact" method="post" action="<? echo $PHP_SELF ?>">
<table align="center" width="380" cellspacing="0" cellpadding="10">
<tr>
<td>Name: *</td>
<td> </td>
<td><input type="text" name="name" size="40"></td>
</tr>
<tr>
<td>Email: *</td>
<td> </td>
<td><input type="text" name="email" size="40"></td>
</tr>
<tr>
<td>AIM:</td>
<td> </td>
<td><input type="text" name="aim" size="40"></td>
</tr>
<tr>
<td>MSN:</td>
<td> </td>
<td><input type="text" name="msn" size="40"></td>
</tr>
<tr>
<td valign="top">Message: *</td>
<td> </td>
<td><textarea name="message" cols="40" rows="8"></textarea></td>
</tr>
<tr>
<td colspan="3" align="right">
<input type="submit" name="submit" value="Send"
style="cursor:pointer">
<input type="reset" name="reset" value="Reset"
style="cursor:pointer">
</td>
</tr>
</table>
<p align="center">Contact <? echo "$site_name"; ?> | * = required field</p>
<input type="hidden" name="ip" value="<? echo $_SERVER["REMOTE_ADDR"]; ?>">
</form>
</body>
</html>