Its a feedback form, so you know what your users think of your site, etc. on the 29th line, change 'nick@host.com' to your email address. This is my first php snippet, so please use constructive critisism.
<html>
<body>
<?php
function spamcheck($field)
{
if(eregi("to:",$field) || eregi("cc:",$field))
{
return TRUE;
}
else
{
return FALSE;
}
}
if (isset($_REQUEST['email']))
{
$mailcheck = spamcheck($_REQUEST['email']);
if ($mailcheck==TRUE)
{
echo "Invalid input";
}
else
{
$email = $_REQUEST['email'] ;
$subject = str_replace(array("\n","\r"),array('',''),$subject);
$message = $_REQUEST['message'] ;
mail("name@host.com", "Subject: $subject",
base64_encode($message), "From: $email",'Content-Transfer-Encoding: base64' );
echo "Thank you for using our mail form";
}
}
else
{
echo "<form method='post' action='mailform.php'>
Email: <input name='email' type='text' /><br />
Subject: <input name='subject' type='text' /><br />
Message:<br />
<textarea name='message' rows='15' cols='40'>
</textarea><br />
<input type='submit' />
</form>";
}
?>
</body>
</html>
Actually Hawkee, the \'email\' input field is telling the person who gets the email the person who sent the emails email address. Basically, if you changed the \'user@host.com\' to blah@blah.net and put the email blah@yahoo.com for the email, and blah for the subject and blah for the body it would send the subject, blah, the message, blah, and it would have \'From: theemailentered\' it also checks if the email is valid. :D