Marian Briones wrote:
> Hi gang
> How do I prevent spam bots from exploiting php scripts that send mail?
>
> Need to know...
>
> (SIGH)
>
> Happy New year by the way.
>
> Marian
My script checks for proper domain, so far so good.
$email = $_POST['email'];
if($email) {
// take a given email address and split it into the username and domain.
list($userName, $mailDomain) = split("@", $email);
if (checkdnsrr($mailDomain, "MX")) {
// this is a valid email domain!
$sql_mailings = "insert into Mailings(email) values('$email')";
$res_mailings = mysql_query( $sql_mailings, $conn) or
die(mysql_error($conn));
echo("Email Added, thanks");
}
else {
// this email domain doesn't exist! bad dog! no biscuit!
echo("<br>Please enter a valid address!");
echo("<br><a href=\"$self\">Back</a>");
}
}
else{
echo (' <form method="post" action="'.$self.'" name="Mailing List">
<small>Add your email address<br>
<input maxlength="150" size="50"
name="email"><input name="Submit" value="submit"
type="submit"><br>
<span style="font-weight: bold; text-decoration:
underline;">Privacy
policy:</span> <br>
The address you enter will not be sold or given
away.</small><br></form>');
}
Skylinux
http://www.network-technologies.org
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/