Computing.Net > Forums > Web Development > Display IP through PHP

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Display IP through PHP

Reply to Message Icon

Name: Spinal
Date: June 5, 2004 at 19:25:55 Pacific
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



Sponsored Link
Ads by Google

Response Number 1
Name: Spinal
Date: June 6, 2004 at 03:31:20 Pacific
Reply:

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


0

Response Number 2
Name: safeTsurfa
Date: June 6, 2004 at 06:06:13 Pacific
Reply:

Umm except you displayed your own host's IP address.

look 146.169.1.10 ... found
Name : linnet.doc.ic.ac.uk (.UK | United Kingdom)
Address : 146.169.1.10

Also, you don't have to use .shtml. You can upload an .htaccess file to your root, containing this line (if your host allows it to be used):

XBitHack on

That will allow you to parse standard .html files as if they were .shtml, by CHMOD-ing the files you wish to be parsed as Owner = rwx.


0

Response Number 3
Name: Spinal
Date: June 6, 2004 at 06:49:04 Pacific
Reply:

Woops! Ok, so if REMOTE_ADDR is the host, how does one get the visitors address?
Spinal


0

Response Number 4
Name: Jamie_McCoy
Date: June 6, 2004 at 06:55:20 Pacific
Reply:

REMOTE_ADDR is the visitors address

Sign Me Guestbook!

jaymc.co.nr


0

Response Number 5
Name: safeTsurfa
Date: June 6, 2004 at 15:04:47 Pacific
Reply:

Then explain why it shows her own address and not mine when I go there?


0

Related Posts

See More



Response Number 6
Name: Spinal
Date: June 6, 2004 at 15:42:27 Pacific
Reply:

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


0

Response Number 7
Name: safeTsurfa
Date: June 6, 2004 at 21:23:05 Pacific
Reply:

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?


0

Response Number 8
Name: Spinal
Date: June 7, 2004 at 04:37:42 Pacific
Reply:

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


0

Response Number 9
Name: chaud
Date: June 7, 2004 at 05:06:34 Pacific
Reply:

Well, it tells me im in some european country, thanks to my proxys, so its kind of useless....why do you need the ip grabber anyway?

Excell Hosting for all your hosting needs.


0

Response Number 10
Name: dzunnea
Date: July 14, 2004 at 09:55:23 Pacific
Reply:

I've found this on google Tracemyip.ph have a look.


0

Sponsored Link
Ads by Google
Reply to Message Icon






Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Display IP through PHP

Ip displayer on a website www.computing.net/answers/webdevel/ip-displayer-on-a-website/2878.html

how to display images in PHP www.computing.net/answers/webdevel/how-to-display-images-in-php-/2164.html

Using a FileMaker Database in PHP www.computing.net/answers/webdevel/using-a-filemaker-database-in-php/1760.html