Page 1 of 1

guestbook inaccessible

Posted: Wed Jul 09, 2014 4:52 pm
by the fool on the hill
Script URL:
Version of script:
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:
Hi,
I hope someone can solve my problem.
My guestbook becomes inaccessible after a certain IP address is banned. Message $lang 'e21' is then displayed to anyone who attempts to read the guestbook. The IP address is that of my hosting company who are not trying to spam my guestbook.

I can clear the message by editing the banned IP address file and removing the address in question. The guestbook then displays, sometimes for a few hours, sometimes for a few minutes.

So far I have tried (without success):
1.Setting 'junkmark_use' to 0, ie off.
2.Settingthe junkmark score to 100.
3.Setting 'junkmark_ban100' to 0, ie off.
4.Setting 'ignore proxy servers' to 1, ie yes.

I have also edited the PHP file to remove the banned IP function but the guestbook then stopped working completely, I can do HTML but very little PHP.

I have been using the guestbook for 4 or 5 years with no problem, this started about 2 months ago. The address being banned is 217.147.80.30 If I look at my stats on c-panel that address is not listed as a visitor to my site.

Thanks in advance ...

Re: guestbook inaccessible

Posted: Wed Jul 09, 2014 5:32 pm
by Klemen
If that IP is banned, no one can view the guestbook?

If this is true, your host probably started using some kind of a proxy system, try setting $settings['ignore_proxies'] to 1 in the settings file and see if that helps.

Re: guestbook inaccessible

Posted: Wed Jul 09, 2014 6:35 pm
by the fool on the hill
Hi Klemen,

Yes that is correct, when that IP is banned, no-one can view the guestbook.

As I said in my post, I have set 'ignore proxy servers' to 1 but this doesn't help.

Re: guestbook inaccessible

Posted: Thu Jul 10, 2014 7:05 am
by Klemen
Sorry, missed it in your post.

Anyway, if your host indeed is using a proxy to access PHP, setting off all filters will not help because the IP gets again banned when a post is banned for another reason.

If you save this as "test.php", upload to GBook folder and open in your browser, what does it say?

Code: Select all

<?php echo "IP: " . $_SERVER['REMOTE_ADDR']; ?>
If it says "IP: 217.147.80.30" then you should talk to your hosting company, because this is an invalid setup and the REMOTE_ADDR environment variable must not be set to the server IP, but to the end user IP.

A (not recommended) work-around might be to disable banning IPs, for example by replacing this function

Code: Select all

function gbook_banIP($ip,$doDie=0)
{
	global $settings, $lang;
    $fp=fopen('banned_ip.txt','a');
    fputs($fp,$ip.'%');
    fclose($fp);
    if ($doDie)
    {
        die($lang['e21']);
    }
    return true;
} // END gbook_banIP()
with just

Code: Select all

function gbook_banIP($ip,$doDie=0)
{
global $settings, $lang;
    if ($doDie)
    {
        die($lang['e21']);
    }
    return true;
} // END gbook_banIP()

Re: guestbook inaccessible

Posted: Thu Jul 10, 2014 8:48 pm
by the fool on the hill
Hello again Klemen, thanks for your time.

test.php does return the IP 217.147.80.30 so I will contact my hosting company. I will also consider the workaround you suggested.

I have never had any spam in my guestbooks (I have 2) in 4 or 5 years, despite some attacks from China lasting for over an hour - well done!