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 ...
guestbook inaccessible
Re: guestbook inaccessible
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.
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.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
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


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
-
- Posts: 6
- Joined: Sat Oct 20, 2012 8:09 pm
Re: guestbook inaccessible
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.
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
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?
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 with just
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']; ?>
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()
Code: Select all
function gbook_banIP($ip,$doDie=0)
{
global $settings, $lang;
if ($doDie)
{
die($lang['e21']);
}
return true;
} // END gbook_banIP()
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here 
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


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
-
- Posts: 6
- Joined: Sat Oct 20, 2012 8:09 pm
Re: guestbook inaccessible
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!
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!