Forum Moderators: coopster

Message Too Old, No Replies

Stopping PHP guestbook spamers?

php to the help

         

hafnius

11:45 pm on Nov 8, 2003 (gmt 0)

10+ Year Member



Hi all

My nice guestbook just got spammed by some joker leaving a link to his own site. The refferer was a Google search for "guestbook"

My question.

How would one go about making it impossible for the same IP to make more than one entry per day? I figure i should use HTTP_user_agent But i am a Newbie to this.

Also i have taken my guestbook dir. and added it to my robots.txt

Do you have any experience or good tips regarding this problem?

Kind Reagards
Hafnius

hakre

12:39 am on Nov 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



- use a database to store guestbook data
- get the ip adress of each user submitting and add it with each entry
- add a timestamp also
- before adding a new entry, check wether that ip was used within the last 24 hours

that's it. but you can't get that freaks if they use a dialup.

MWpro

2:49 am on Nov 9, 2003 (gmt 0)

10+ Year Member



You are too nice... I would have just banned him completely with the .htaccess. Hakre's method is excellent. For the people with dialup, you can always just set a cookie.

hakre

1:12 pm on Nov 9, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



combination of both (cookie and ip-log/ban) might then be the best.

i think .htaccess ban is the solution to block a fixed ip user in case of emergency.