IP address

Dr. GBooky is here to help you with your guestbook problems ...
Post Reply
editpoint
Posts: 7
Joined: Wed Jul 29, 2009 3:51 pm

IP address

Post by editpoint »

Script URL:
Version of script:1.6
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:entries.txt, blank entries, banned ip

Write your message below:
Hi
When looking at the entries.txt file or when i sign into the guestbook and check View IP all the entries have the same IP address. Every now and then this ip addresss appears in banned_ip.txt. Resulting in a blank questbook. I have included the line in gbook.php to allow the IP address but why have all the entires got the same address?

The address is 10.1.6.1

Thanks
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Must be a server-side setting overriding all IP addresses. 10.1.6.1 is a local IP (from the reserved private (intranet) range), not an internet-one.
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
editpoint
Posts: 7
Joined: Wed Jul 29, 2009 3:51 pm

Post by editpoint »

Ok Thanks but what does that mean:-) ? Why would my server be changing the ip address? I have another site which uses guestbook and the entries in there have different ip addresses.

Could it be virus/trojan related?
Henrie
Posts: 1095
Joined: Sun Aug 14, 2005 8:57 pm

Post by Henrie »

The GBook logs the value returned by _SERVER["REMOTE_ADDR"]
Probably your server somehow returns its internal IP like maybe given by _SERVER["SERVER_ADDR"]
You can check if this is true if you have phpinfo.php file on your server. See the link for download in this topic viewtopic.php?t=83

I don't think it is a virus/trojan, just some strange configuration of the server.

Greetings,
Henrie
I do not monitor the Gbook forums regularly anymore since I do not use the Gbook script myself anymore for a long time. But it helped me a lot in learning to understand php.
editpoint
Posts: 7
Joined: Wed Jul 29, 2009 3:51 pm

Post by editpoint »

Yes using phpinfo _SERVER["REMOTE_ADDR"] is 10.1.6.1 and _SERVER["REMOTE_ADDR"] is 10.1.6.102.

So, is this normal? if it is i dont see the point of being able to view an IP address or ban an ip because you are effectively banning yourself.

Bit confused!!
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

It's not normal and it is a server-side issue. Talk to with your host why a local IP is listed in PHP variable $_SERVER['REMOTE_ADDR'] instead of the actual one.

There really is nothing we can help here. It's a server issue and your host must fix it. It has nothing to do with GBook code.
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
DC
Posts: 138
Joined: Sun Dec 09, 2007 9:28 am

Post by DC »

That is odd I have never seen that problem and no way that's normal, as I have dealt with a lot of servers, and never once came across that issue. I would notify them ASAP as Klem has said, and have them fix it ... do not let them tell you that its normal. I say this as some hosts like you to think they are right and the user is wrong, if they say something like that send them to this thread.

I have proven many a server company wrong even though they may try to say they are correct, so I am always prepared for some far out incorrect answer that they may try to justify.

My hope is they will just fix the issue for you.

DC
To Code Or Not To Code That Is The Question?

Was my post of any help to you? if so please do [url=http://www.clickcraft.net/slice_donations.php][b]Buy Me A Slice[/b][/url] ...
editpoint
Posts: 7
Joined: Wed Jul 29, 2009 3:51 pm

Post by editpoint »

Ok.

Thanks a lot for your help. I'll get in touch with my ISP
editpoint
Posts: 7
Joined: Wed Jul 29, 2009 3:51 pm

Post by editpoint »

Hi. back again!

My ISP has responded thus:
The development team have set up a script under guestbook
called test.php which will show you the variables that can
be used.

you will need to use:

HTTP_X_FORWARDED_FOR

to record the remote IP address.

Does that make sense? Does this mean I will have to edit the script?
Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

Can you upload the phpinfo.php file (it's in the first post in the forum) to your server and post a link to it here so I can check what variables exactly are set on your server?
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
editpoint
Posts: 7
Joined: Wed Jul 29, 2009 3:51 pm

Post by editpoint »

Klemen
Site Admin
Posts: 10116
Joined: Fri Feb 11, 2005 4:04 pm

Post by Klemen »

OK, shouldn't be a problem.

Open gbook.php in Notepad and change REMOTE_ADDR to HTTP_X_FORWARDED_FOR (twice in the gbook.php file).

Don't change anything else in gbook.php.

Also in your settings.php file make sure variable $settings['ignore_proxies'] is set to 1.

Upload both modified files, close all browser windows then open your guestbook and test it.

Note that existing posts won't be affected, but IP should be shown correctly for new posts from now on.
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
editpoint
Posts: 7
Joined: Wed Jul 29, 2009 3:51 pm

Post by editpoint »

Hi
Thanks a lot. Excellent support!

That seems to work OK with a couple of test entries.

Now hopefully i can ban that pesky person who keeps leaving rubbish in my guestbook.
Post Reply