cragllo 0 Report post Posted December 6, 2004 (edited) Want to show the IP of the visitor to your site?All you have to do is add this code to your page where you want the IP to be shown: <?php[/br]echo "Your IP is $_SERVER["REMOTE_ADDR"]";?> Edited August 6, 2005 by cragllo (see edit history) Share this post Link to post Share on other sites
desimela 0 Report post Posted December 7, 2004 o tht was a cool lil scriptthx for shairing Share this post Link to post Share on other sites
nancmu 0 Report post Posted December 15, 2004 (edited) This is one choice!! i usually use this for count my user and show ip. i got user more... if (getenv(HTTP_CLIENT_IP)) { // check ip from share internet $ip = getenv(HTTP_CLIENT_IP);} elseif (getenv(HTTP_X_FORWARDED_FOR)) { // ip is pass from proxy?? $ip = getenv(HTTP_X_FORWARDED_FOR);} else { $ip = getenv(REMOTE_ADDR);} Edited May 21, 2012 by moderator (see edit history) Share this post Link to post Share on other sites
faceofdie 0 Report post Posted December 31, 2004 (edited) I Use this Code :: < ?echo "Your IP is $REMOTE_ADDR";?>but It Show Me Last IP and Not Today IPwhat is problem >? Edited May 21, 2012 by moderator (see edit history) Share this post Link to post Share on other sites
cragllo 0 Report post Posted December 31, 2004 (edited) What do you mean Last IP? Go to the page where that code it, and then go into dos and type in ipconfigit the ip's match, then it is working ok...if you nitice there is a space between the < and the ?, take taht out, so it should look like <? try that... Edited December 31, 2004 by cragllo (see edit history) Share this post Link to post Share on other sites
mrkill47 0 Report post Posted December 31, 2004 (edited) i tried it and it doesn't work for me either, i get this error:Notice: Undefined variable: REMOTE_ADDR in c:program fileseasyphp1-7wwwindex.php on line 10Code i used is: <p><?php echo "Your IP is $REMOTE_ADDR"; ?></p> the page is located here: http://forums.xisto.com/no_longer_exists/ (this is my home pc/server btw, its not always up lol... sorry if its down) Edited May 21, 2012 by moderator (see edit history) Share this post Link to post Share on other sites
cragllo 0 Report post Posted December 31, 2004 Are all the features og PHP turned on, on your server? Share this post Link to post Share on other sites
mrkill47 0 Report post Posted December 31, 2004 (edited) not sure lol, does this help: http://forums.xisto.com/no_longer_exists/i tried this code instead: echo "User's IP address: " . $_SERVER["REMOTE_ADDR"]; that seems to have worked... Edited May 21, 2012 by moderator (see edit history) Share this post Link to post Share on other sites
FaLgoR 0 Report post Posted January 3, 2005 If global vars are turned on, use $REMOTE_ADDR, else, use $_SERVER["REMOTE_ADDR"]. Share this post Link to post Share on other sites
iGuest 3 Report post Posted February 5, 2009 (edited) Use <?If (getenv(HTTP_CLIENT_IP)) {$ip = getenv(HTTP_CLIENT_IP);} elseif (getenv(HTTP_X_FORWARDED_FOR)) {$ip = getenv(HTTP_X_FORWARDED_FOR);} else {$ip = getenv(REMOTE_ADDR);} Echo "Your IP is $ip";?> already script for you. -reply by AnonymousKeywords: Edited May 21, 2012 by moderator (see edit history) Share this post Link to post Share on other sites
Jothsha 0 Report post Posted March 8, 2011 I've got a better idea. You visit the site Ip-Details and there is a code which you copy and paste in the website program will be displayed in your site. It shows not only the ip address but also the location and the address of the visitor. Share this post Link to post Share on other sites