ChillyBob
06-25-2002, 12:12 PM
I've been searching but I can't find how to display a visitors IP address in their browser on a normal html page.
I know it's something to do with REMOTE_ADDR, can you help?
akashik
06-25-2002, 01:26 PM
IP Address: <?php echo $REMOTE_ADDR;
Host: <?php echo $REMOTE_HOST; ?>
Chicken
06-25-2002, 01:32 PM
Would:
<? print("IP is $REMOTE_ADDR"); ?>
Do the same thing? I'm no coder (far far far far far from it), just wondering from someone who knows.
DjPaj
06-25-2002, 02:48 PM
Originally posted by Chicken
Would:
<? print("IP is $REMOTE_ADDR"); ?>
Do the same thing? I'm no coder (far far far far far from it), just wondering from someone who knows.
yeap it will. So many different ways to do it, all depends on your coding style.
Studio64
06-25-2002, 03:13 PM
Or if you want to get really technical (I won't b/c quite frankly I don't want to go dig through my books)...
You could grab the entire HTTP Headers as an array and go through it...
But yeah... $REMOTE_ADDR is a fairly easy way :D
mwatkins
06-25-2002, 04:01 PM
Or you can use SSI if you don't want to use PHP for some reason.
<!--#echo var="REMOTE_ADDR" -->
http://httpd.apache.org/docs/mod/mod_include.html
Read the Apache security docs on SSI as well.
Radix
06-25-2002, 06:02 PM
I think this can be done with javascript and maybe SSI as well.
filburt1
06-25-2002, 06:39 PM
Javascript: Don't believe so
SSI: Yes...just answered above