/    Sign up×
Community /Pin to ProfileBookmark

I’m getting spammed badly…help?!

Hello,

My email is getting spammed badly by spambots.

I am currently using the following code for sending email from a form.

[code=php]
<?

$mailto = ‘[email protected]’ ;

$subject = “Feedback from test.co.uk” ;

$formurl = “http://www.test.co.uk/contact.html” ;
$errorurl = “http://www.test.co.uk/contact_error.html” ;
$thankyouurl = “http://www.test.co.uk/contact_ty.html” ;

$name = $_POST[‘name’] ;
$email = $_POST[’email’] ;
$comments = $_POST[‘comments’] ;
$http_referrer = getenv( “HTTP_REFERER” );

if (!isset($_POST[’email’])) {
header( “Location: $formurl” );
exit ;
}
if (empty($name) || empty($email) || empty($comments)) {
header( “Location: $errorurl” );
exit ;
}
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}

$messageproper =

“This message was sent from:n” .
“$http_referrern” .
“————————- COMMENTS ————————-nn” .
$comments .
“nn————————————————————n” ;

$messageproper = eregi_replace(“@”, “”, $messageproper);
$name = eregi_replace(“@”, “”, $name);

mail(strip_tags($mailto), strip_tags($subject), strip_tags($messageproper), “From: “$name” <$email>nReply-To: “$name” <$email>nX-Mailer: chfeedback.php 2.02″ );
header( “Location: $thankyouurl” );
exit ;

?>
[/code]

Is there anything I should do to this script to make it unspammable ?

Thanks in advance,

Michael.

to post a comment
PHP

5 Comments(s)

Copy linkTweet thisAlerts:
@sameer_net_inJul 29.2006 — use image protection,

or atleast make the user type some keycode to verify its human.

Image protection is the best way.
Copy linkTweet thisAlerts:
@invisionauthorJul 29.2006 — Is that easy to do ?

Any useful tutorial links you can give me ?

Do you think that will definitely stop the spam from getting through ?

It's only recently started happening.
Copy linkTweet thisAlerts:
@sameer_net_inJul 29.2006 — read a sample on

http://www.codingforums.com/archive/index.php?t-73869.html

or you can google 'php image validation'

without single quote.
Copy linkTweet thisAlerts:
@invisionauthorJul 29.2006 — OK. Seems quite complex. I'm OK at PHP, but not great.

Any easier solutions ? Sorry, if it comes across I'm so lazy. I'm a bit flu-ridden atm heh.

Thanks for the help so far.
Copy linkTweet thisAlerts:
@NogDogJul 29.2006 — Bokeh has a script on his site you might want to look at: http://bokehman.com/captcha_verification
×

Success!

Help @invision spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...