Show Visitors Ip Addresss

free web hosting
Open Discussion > CONTRIBUTE > Computers > Programming Languages > PHP Programming

Show Visitors Ip Addresss

cragllo
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:

CODE
<?php
echo "Your IP is $_SERVER["REMOTE_ADDR"]";
?>

Reply

desimela
o tht was a cool lil script
thx for shairing

Reply

nancmu
This is one choice!! smile.gif
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);
}

Reply

faceofdie
I Use this Code ::
< ?
echo "Your IP is $REMOTE_ADDR";
?>
but It Show Me Last IP and Not Today IP
what is problem >?

Reply

cragllo
What do you mean Last IP? Go to the page where that code it, and then go into dos and type in ipconfig
it 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...

Reply

mrkill47
i tried it and it doesn't work for me either, i get this error:

Notice: Undefined variable: REMOTE_ADDR in c:\program files\easyphp1-7\www\index.php on line 10

Code i used is:

<p><?php echo "Your IP is $REMOTE_ADDR"; ?></p>

the page is located here: http://82.43.57.227/index.php (this is my home pc/server btw, its not always up lol... sorry if its down)

Reply

cragllo
Are all the features og PHP turned on, on your server?

Reply

mrkill47
not sure lol, does this help: http://82.43.57.227/uwd/index.php?page=phpinfo

i tried this code instead:

echo "User's IP address: " . $_SERVER["REMOTE_ADDR"];

that seems to have worked...

Reply

FaLgoR
If global vars are turned on, use $REMOTE_ADDR, else, use $_SERVER["REMOTE_ADDR"]. smile.gif

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Recent Queries:-
  1. show vistors ip - 0.33 hr back. (1)
  2. show visitors ip on drupal site - 12.99 hr back. (1)
  3. ip show html code - 24.97 hr back. (1)
  4. visitor ip show - 28.66 hr back. (2)
  5. show ip on html - 32.52 hr back. (1)
  6. php count visitors ip - 48.48 hr back. (1)
  7. list all website visitors ip - 49.27 hr back. (1)
  8. how to show ip on page - 58.70 hr back. (1)
  9. check ip visitor - 72.90 hr back. (2)
  10. html code visitor ip - 74.18 hr back. (1)
  11. show ip html code - 76.22 hr back. (1)
  12. show visitor ip website - 91.43 hr back. (1)
  13. code show visitor ip - 98.23 hr back. (1)
  14. show last visitor ip address - 99.36 hr back. (1)
Similar Topics

Keywords : show, visitors, ip, addresss

  1. <?php ?> Unique Visitors Script
    Flat file unique visitors script (no sessions) (2)
  2. Visitors Online
    With PHP (no MySQL is needed) (9)
    Another script, which shows the visitors onlineat the moment in your site. This script was not made
    by me, I just think it will be very usefull to u. CODE <? $timeout = 15; // change
    it. It is the timer which will delete the member of  online list (in minutes) if
    (!$datei) $datei = dirname(__FILE__)."/online.txt"; $time
    = @time(); $ip = $REMOTE_ADDR; $string =
    "$ip|$time\n"; $a = fopen("online.txt", "a+");
    fputs($a, $s....
  3. Visitors Counter
    With PHP (no MySQL needed!) (4)
    Well, here we will make an hit counterusing php and an *.txt file. This script is so simple, but
    very usefull. First, le'ts make an file called counter.php, with the following codes inside:
    CODE <? $file = 'counter.txt'; // this is the file where the number of visitors
    will be written $fopen = fopen("$file", "r"); // open the text
    file $count = fread($fopen, 1024); // read the text file fclose($fp);
    // close the text file $count = $count + 1; // add one more hit echo &#....
  4. Php Hit Counter
    record your visitors... (1)
    All you do is copy this code into the page you want to display it on. CODE <?php
    $counterfile = "counter.txt"; $counter =
    file("$counterfile"); $c = $counter[0]; if
    (strlen($c) == 0) {$c=0;} $c=$c+1; $a =
    fopen("$counterfile", "w"); fwrite($a, $counter =
    ""); fputs($a, $c); fclose($a); echo
    ("$c"); ?> Make a file called 'counter.txt' in the same ....

    1. Looking for show, visitors, ip, addresss

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for show, visitors, ip, addresss

*MORE FROM TRAP17.COM*
advertisement



Show Visitors Ip Addresss



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE