Forum Moderators: coopster
I am running a simple enquiry form on my website. Yesterday I received 245 "enquiries" from spammers, which almost killed my e-mail.
So my mailer sript looks like this:
<?php
$entry = $_POST['entry1'];
$subject = "My Subject";
$message = "$entry";
if ($entry > 4) {
header( "location: veryRudeURL/" );
} else {
mail($to, $subject, $message, "From: $name <$email>\nX-Mailer: PHP/" . phpversion());
header( "location: thankyou.html" );
}
?>
When I test this script on my browser, and enter a string that is longer than 4 characters, I get transfered to the veryRudeURL - it is a certain URL where a spambot would just crash because... vell, just because :D
When a spambot uses this script, it doesn't work on my benefit and even when it enters a string longer than 4 characters, it gets through :(
What did I do wrong? Why it works in my browser and fails to work with spambot?
The injection probably came from your headers. You should sanitize the header data better.
dc
Try a search on Google for some more information:
[google.co.uk...]
dc