Name: Spinal Date: June 5, 2004 at 19:25:55 Pacific Subject: Display IP through PHP OS: W2K CPU/Ram: 1Ghz,1Gb
Comment:
Greetingz! I've new to web development, and have made a submit an email form using the standard form in html scrpt. Sadly, I need to email with the users IP address. This is what I've come up with to display the IP address, but when I check it with dreamweaver I see nothing, nor do I see anything on my server when I upload it. Any ideas appreciated. This is the script:
888888888888888888888888888888888888888888<? echo "$REMOTE_ADDR"; ?> <?php echo $REMOTE_ADDR; ?> <? $hst = $_SERVER["HTTP_HOST"]; $uri = $_SERVER["REQUEST_URI"]; $rmt = $_SERVER["REMOTE_ADDR"]; $br = $_SERVER["HTTP_USER_AGENT"]; echo "Your IP address reflects as : $rmt \n \n The page you requested was: $uri \n \n The browser you are using is $br"; ?> 88888888888888888888888888888888888888888888 im trying to use it here if you wish to see it: http://www.doc.ic.ac.uk/~md103/addMe.htm Thanx, Michele
UPDATE! I have discovered what was wrong. Im posting this for other who might be in my same headcase. The file addme.htm should be renamed to addme.Shtml. the S for server side includes. SPinal
Hello again. I have been quite perplexed by this. According to the apache documentation, REMOTE_ADDR is the visitors address. Also, when I look at the source of other sites that show my ip, they use remote addr. I've come to the assumption that the server has some for of anonymous proxy and/or firewall that stops the REMOTE_ADDR from working properly. Spinal
No idea. I am tempted to suggest that as it's on a .ac.uk network, they may have special protections in place to comply with some govt. regulations re. academic domains, etc. Maybe Jamie could try a mirror on his site, since he is in a .ac.uk arena too, see what happens?
If Jamie want to try (I know him by fame, his posts precede him :p ); he can feel free to do so. I have a prolog exam tomorrow, so I'm going into uni, let's see if they can answer some questions. Spinal
The information on Computing.Net is the opinions of its users. Such
opinions may not be accurate and they are to be used at your own risk.
Computing.Net cannot verify the validity of the statements made on this site. Computing.Net and Computing.Net, LLC hereby disclaim all responsibility and liability for the content of Computing.Net and its accuracy.
PLEASE READ THE FULL DISCLAIMER AND LEGAL TERMS BY CLICKING HERE