I desperatly need a PHP mail form script. It NEEDS to make sure that the person entering in their email address is infact, a real email address. Also, it needs to have their IP address sent to me. If you make one, or point me in the direction of one, I will be most greatful.
I need this because someone (or multiple people) keep spamming me with the contact form at my website.
Thank you all, and again I will be most greatful.
Need PHP mail form! Please :(
Moderator: General Moderators
O.K i never give something free, but there is always the first time 
i'll give you an example:
hope it helps =]
i'll give you an example:
Code: Select all
<html>
<head>
<title>Contact Form</title>
</head>
<body>
<?
if(!$_POST['name'])
{
?>
<form action="<? $_SERVER['PHP_SELF']; ?>" method="post">
<table dir="ltr" style="width: 850px;">
<tr>
<td>
Your name:
</td>
<td>
<input type="text" name="name" />
</td>
</tr>
<tr>
<td>
Subject:
</td>
<td>
<input type="text" name="subject" style="width: 150px;" />
</td>
</tr>
<tr>
<td valign="top">
Your Message:
</td>
<td>
<textarea cols="40" rows="10" name="MsgBody" />
</td>
</tr>
<tr>
<td colspan="2">
* Your IP will recorded!
</td>
</tr>
<tr>
<td>
<input type="submit" value="submit" />
</td>
</tr>
</table>
</form>
<?
}
else
{
if($_POST['name'] == NULL || $_POST['subject'] == NULL || $_POST['MsgBody'])
{
die("Please complete the form.");
}
else
{
mail("YOURMAIL@YOURDOMAIN.COM","{$_POST['subject']}","
Your Name: {$_POST['name']}
Your Subject: {$_POST['subject']}
Your Message:
{$_POST['MsgBody']}
User IP: {$_SERVER['REMOTE_ADDR']}
");
echo "Your mail has been sent, one of the administartors will replay soon.";
}
}
?>
</body>
</html>hope it helps =]
User http://php.net/preg_match and check if it includes the basic form [ (S+)@(S+).(S+) ]....