Question about Guestbook

Dr. GBooky is here to help you with your guestbook problems ...
Maxtor

Question about Guestbook

Post by Maxtor »

Script URL: N/A
Version of script: N/A
Version of PHP: N/A
Hosting company: N/A
Have you searched THIS FORUM for your problem: Yes
(if not please do before posting)
If so, what terms did you try: N/A

Write your message below:

Hi,

I'm looking over your guestbook but I have a few questions.

1. Does this guestbook log the IP of the poster?
2. Does it have a place to enter IP's you wish to ban? (So they can no longer post.)

Thanks
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

Hello Maxtor,

To answer your questions:
1. No, it does not log the IP of the poster.
2. No, it does not have a place to enter IP's you wish to ban.

Greetings,
Henrie
Maxtor

Post by Maxtor »

What do you do if you have a spammer then? Seems like you can't stop him other then removing the link to the guest book for awhile.

Do you know if there are plans to add those?

Thanks
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

I haven't used gbook on a spam infested site but i will soon, now i have it only running on my personal site which is only known to a few people. I hope and think that most spammers on the spam infested site i have are robots and thus they will be blocked because they have to fill in the spamblocker code.
And if i have a lot of manual spammers i think i will add ip-logging myself so that i can see the ip-numbers and then will block access to gbook by using a .htaccess file as i am doing with the guestbook i am using right now.
Maybe if i get to much of those spammers in the future i will write some code myself to add ip-blocking but i don't know how to do that now so i will first have to expand my php knowledge to do that.

I don't know if Klemen Stirn has plans to write this code for gbook but i think from reading these forums that now he is working on hesk so i don't think he will work on gbook any time soon.
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Hi there,

Henrie is right, most spammers have robots (scripts, programs) which automatically sign thousands of guestbooks. The "Enter security code" in GBook prevents these automated signups.

In my opinion IP ban is not really the way to go as majority of people have dynamic IP numbers meaning their IP changes everytime they connect to the internet. So if you ban an IP a spammer can simply disconnect from the internet, reconnect and he'll be able to post again as he now has a different IP ("he" or "she").

I suggest you try GBook for maybe a week or a month and see if the code filter helps you eliminate spam. From what I've heard from the people using GBook it has reduced spam to a minimum.

Regards
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
FruitBeard
Posts: 38
Joined: Thu Jul 21, 2005 6:25 pm

Post by FruitBeard »

The answers given to you before are all too true about the pros and cons of banning ip's etc.

but you can do this, you will have to manually add the ip addresses yourself which you will recieve in your notification email, only if you set your settings to receive a reply email.

in settings.php add this somewhere

$settings['CHECKIP'] = array('127.9.0.1','129.0.0.2','127.0.0.1','86.133.165.7');

or any addresses you receive or wish to ban, 127.0.0.1 is your local address!so you can test it.

find in gbook.php

printTopHTML(); ( should be on line 55, or there abouts !)

and underneath it paste this code.

$IP = $_SERVER["REMOTE_ADDR"];
$CHECKBAN =1;
foreach ($settings['CHECKIP'] as $BANLIST)
{if (preg_match("/$BANLIST/i",$IP))
{$CHECKBAN=0; break; } }
if (!$CHECKBAN)
{problem('Your IP has been banned');}

and then find

$char = array('.','@');
$repl = array(".","@");
$email=str_replace($repl,$char,$email);
$IP = $_SERVER["REMOTE_ADDR"];
$message = "Hello!

Someone has just signed your guestbook!

Name: $name
From: $from
E-mail: $email
Website: $url
sent on: $added
IP: $IP

and replace with

$char = array('.','@');
$repl = array(".","@");
$email=str_replace($repl,$char,$email);
$IP = $_SERVER["REMOTE_ADDR"];
$message = "Hello!

Someone has just signed your guestbook!

Name: $name
From: $from
E-mail: $email
Website: $url
sent on: $added
IP: $IP

voila, it works , because i tested and tested and tested

you can also block a whole range of ip's by assigning something like this
in the $settings['CHECKIP'] = array('127.9.0.1','129.0.0.2','127.0.0.1','86.133.*.*');

but that would block too many people and you obviously dont want that.

http://www.fgps.com/keith/
:D
FruitFully yours

http://www.fgps.com/keith/
Maxtor

Post by Maxtor »

Thanks, i'll give it a try.
Maxtor

Post by Maxtor »

Oh, one other thing.

Do I need to also add this mod for yours to work FruitBeard?

viewtopic.php?t=36
IP tracking for PHP guestbook V 1.33

Thanks
FruitBeard
Posts: 38
Joined: Thu Jul 21, 2005 6:25 pm

Post by FruitBeard »

HI

Not sure what mod you mean, but i think you mean getting their ip address to be shown to you,

well it will be posted to you, but alas only if they submit a reply email address.

so they could still spam if they dont put an email address, which i dont think they will do if they are going to spam you.

i shall get on to displaying the ip for you, so you know what it is without them entering an email

then all you do is note the ip and log it to the settings file part.
FruitFully yours

http://www.fgps.com/keith/
Maxtor

Post by Maxtor »

Thank you
FruitBeard
Posts: 38
Joined: Thu Jul 21, 2005 6:25 pm

Post by FruitBeard »

Hello

I just remembered, the email you get will tell you the persons IP whether they post a return email or not,

the email will tell you all the details plus time added and their current or most recent IP address.

you will have to check your emails to gather the ip of certain spammers etc etc
FruitFully yours

http://www.fgps.com/keith/
Maxtor

Post by Maxtor »

Alright, i'll give your code a go then. Thanks for posting it.
Maxtor

Post by Maxtor »

Hi FruitBeard,

I just installed the guestbook but I have two issues.

1. I'm not getting an IP in the e-mail

2. And when I added your code I got " Invalid argument supplied for foreach()" which was from the below code.

Code: Select all

$IP = $_SERVER["REMOTE_ADDR"];
$CHECKBAN =1;
foreach ($settings['CHECKIP'] as $BANLIST)
{if (preg_match("/$BANLIST/i",$IP))
{$CHECKBAN=0; break; } }
if (!$CHECKBAN)
{problem('Your IP has been banned');} 
Thanks
Guest

Post by Guest »

hi,

did you put this in the settings.php file ?

$settings['CHECKIP'] = array('127.9.0.1','129.0.0.2','127.0.0.1','86.133.165.7');

and did you replace
____________________________________________________

$char = array('.','@');
$repl = array(".","@");
$email=str_replace($repl,$char,$email);
$IP = $_SERVER["REMOTE_ADDR"];
$message = "Hello!

Someone has just signed your guestbook!

Name: $name
From: $from
E-mail: $email
Website: $url
____________________________________________________
with

$char = array('.','@');
$repl = array(".","@");
$email=str_replace($repl,$char,$email);
$IP = $_SERVER["REMOTE_ADDR"];
$message = "Hello!

Someone has just signed your guestbook!

Name: $name
From: $from
E-mail: $email
Website: $url
sent on: $added
IP: $IP
____________________________________________________
Maxtor

Post by Maxtor »

Alright, I got it that time. I guess I made an error before.

Now, what are these IP's for? '127.9.0.1','129.0.0.2','127.0.0.1','86.133.165.7' ? I mean, can I remove them and leave the below? As I have no IP's I wish to ban yet.

$settings['CHECKIP'] = array('');

Thanks
Post Reply