heres the way i use to get feedback from our site.
[php]
<?
/*Senders Address */
$sendto="
[email protected]";
/*Your Name or "The Web Admin" */
$sendtoname = "The Web Admin";
/*E-Mail Subject When the Mail is received */
$emailsubject="$serveraddress! - $visitorName Would Like to Speak to you!";
/* How do We want to thank them for the message they sent? */
$thankyou="Your message been sent To $sendtoname, thank you!";
/*Visitor Forgot his name. What do we say to them? */
$ErrorName = "Please enter your name. I would like to be able to call you Something other than Newb.";
/*Visitor Forgot his E-Mail. How do they execpt us to e-mail him back */
$ErrorEMail = "Please enter your email address! I need a valid E-Mail address so i can reply.";
/*Visitor Forgot what they wanted to say to us. How do we respond? */
$ErrorMessage = "Please enter your comments! I need to know what you want. To stop spamming i have logged your ip address be smart.";
/*Return Page? Were do we want them to go after it is sent? no http://yoursite.com/ that is done for you.*/
$ReturnPage = "home.htm";
/* Dont Change Anything Below */
$serveraddress = $_SERVER['SERVER_NAME'];
$client = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$UserAgent = $_SERVER["HTTP_USER_AGENT"];
$UserIPPort = $_SERVER["REMOTE_ADDR"] . ":" . $_SERVER["REMOTE_PORT"];
$redirect = "<meta http-equiv=\"refresh\" content=\"2;url=http://".$serveraddress."/".$ReturnPage."\">";
if ($submit) {
if ($visitorName <= "")
$message="$ErrorName";
else if ($visitorEmail <= "")
$message="$ErrorEMail";
else if ($comments <= "")
$message="$ErrorMessage";
if ($message)
echo ($message);
else {
$FullMessage = "\r\nName: $visitorName\r\nEmail: $visitorEmail\r\nComments
r\n$comments\n\nSenders Information
n Address: $client\nUser Agent: $UserAgent\n IP
ort : $UserIPPort\n";
mail("$sendto", "$emailsubject", "$FullMessage", "From: $visitorName <$visitorEmail>");
echo "$redirect";
echo ("<br><br> $thankyou" );
die();
}
}
?>
Contact The WebAdmins. &nbs p; Addres Information is sent with E-mail*<br />
<form method="post">
<p>
<font face="Verdana,sans serif" size="2">
Your Name:</font>
<br>
<input type="text" size="40" name="visitorName">
<br>
<font face="Verdana,sans serif" size="2">
Your email address - valid please or i cant reply to you:</font>
<br>
<input type="text" size="40" name="visitorEmail">
<br>
<font face="Verdana,sans serif" size="2">
Errors and comments here please:</font>
<br>
<textarea name="comments" cols=30 rows=10></textarea>
<p>
<font size="1">
<input type="submit" name="submit" value="submit E-Mail">
<br />
<br />
* Your IP is sent with The e-mail to prevent people from abusing the mailing system. Please have no worries about your Information.<br/> Your Information: <?php echo "Information:<br/> Address: $client <br/>User Agent: $UserAgent<br/> IP
ort : $UserIPPort"; ?></font>
</form>[/php]