FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Need Something like www.whatismyip.com





justy
Hi all,

Need a PHP script which just able to Show my Public IP like http://www.whatismyip.com , is there anything available..

Thanks
MrBlueSky
The easiest way is this:

Code:

<?php
 
   echo $_SERVER['REMOTE_ADDR'];

?>
AftershockVibe
You can even expand on it a bit and give the hostname of that IP at the same time.

Code:
<?php
 
   echo 'Your IP is '$_SERVER['REMOTE_ADDR'] . 'with Host Name ' . $_SERVER['REMOTE_HOST'];

?>


Note that the hostname will (most likely) be the hostname of the gateway through which you connect to the internet and will therefore usually tell you your ISP. It will not give you the actual hostname of your machine unless for some bizzare reason you have an IP directly accessible from the net.

Bear this in mind if you're testing on a local machine as you'll get different results compared to when you upload it.
AOP Web Development
Can you get it even it the visitor surf anonymously? i mean even they try to use proxy ip?
fromegame
No, if he uses a proxy, you'll get the proxy's IP.
Related topics
I was wondering something if anyone might know the awnser...
servers
MySQL
Make your own MMORPG !
How to setup a shoutcast server, nice and easy tutorial
Bandwidth for Webserver.....
Build Web Hosting Server Help!
Remote Desktop Problem
{{ReSiMLi}}Winamp tan radyo yayn
[man]Server de RO Con mysql
[man]Guia para abrir puertos
HOW 2 get my Public/External IP address in VisualBasic 2005
Starting your own web server tutorial
Im using apahe,php, and mysql and dreamweaver (HELP)
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.