Php Ip Address

liunx

Guest
Hi there, <br /><br />i am using php and wish to view the ip address of a visitor.<br />I notice that when in the cPanel it gives my ip address and its bang on, but when i use<br /><br />$_SERVER["REMOTE_ADDR"]; <br /><br />in my own code, its not the same. I think the php code above shos my ISP Proxy IP Address.<br />This is not my actuall ip. <br /><br />How can i get the accuracy that cPanel shows??<br />Is there something else i need to do to this php function ??<br /><br />Thanks for your thoughts.<br /><br />G_N<!--content-->
If you use a proxy, your IP will be in the x-forwarded-for header, check out the examples on this page:<br /><a href="http://www.php.net/getenv" target="_blank">http://www.php.net/getenv</a><br />To get an idea of how to find the correct IP address.<br /><br />HTH<!--content-->
Thanks, i am not behind a proxy at my end.<br />I have looked at some of the exaples, and have managed to get what i need. Thanks again<br /><br />Take Care<br /><br />G_N<!--content-->
 
Back
Top