Specialty Forums
Security and Virus
General Hardware
CPUs/Overclocking
Networking
Digital Photo/Video
Office Software
PC Gaming
Console Gaming
Programming
Database
Web Development
Digital Home

General Forums
Windows XP
Windows Vista
Windows 95/98
Windows Me
Windows NT
Windows 2000
Win Server 2008
Win Server 2003
Windows 3.1
Linux
PDAs
BeOS
Novell Netware
OpenVMS
Solaris
Disk Op. System
Unix
Mac
OS/2

Drivers
Driver Scan
Driver Forum

Software
Automatic Updates

BIOS Updates

My Computing.Net

Solution Center

Free IT eBook

Howtos

Site Search

Message Find

RSS Feeds

Install Guides

Data Recovery

About

Home
Reply to Message Icon Go to Main Page Icon

Display IP through PHP

Original Message
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


Report Offensive Message For Removal


Response Number 1
Name: Spinal
Date: June 6, 2004 at 03:31:20 Pacific
Subject: Display IP through PHP
Reply: (edit)
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

Report Offensive Follow Up For Removal

Response Number 2
Name: safeTsurfa
Date: June 6, 2004 at 06:06:13 Pacific
Subject: Display IP through PHP
Reply: (edit)
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.


Report Offensive Follow Up For Removal

Response Number 3
Name: Spinal
Date: June 6, 2004 at 06:49:04 Pacific
Subject: Display IP through PHP
Reply: (edit)
Woops! Ok, so if REMOTE_ADDR is the host, how does one get the visitors address?
Spinal

Report Offensive Follow Up For Removal

Response Number 4
Name: Jamie_McCoy
Date: June 6, 2004 at 06:55:20 Pacific
Subject: Display IP through PHP
Reply: (edit)
REMOTE_ADDR is the visitors address

Sign Me Guestbook!

jaymc.co.nr


Report Offensive Follow Up For Removal

Response Number 5
Name: safeTsurfa
Date: June 6, 2004 at 15:04:47 Pacific
Subject: Display IP through PHP
Reply: (edit)
Then explain why it shows her own address and not mine when I go there?

Report Offensive Follow Up For Removal


Response Number 6
Name: Spinal
Date: June 6, 2004 at 15:42:27 Pacific
Subject: Display IP through PHP
Reply: (edit)
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

Report Offensive Follow Up For Removal

Response Number 7
Name: safeTsurfa
Date: June 6, 2004 at 21:23:05 Pacific
Subject: Display IP through PHP
Reply: (edit)
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?

Report Offensive Follow Up For Removal

Response Number 8
Name: Spinal
Date: June 7, 2004 at 04:37:42 Pacific
Subject: Display IP through PHP
Reply: (edit)
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

Report Offensive Follow Up For Removal

Response Number 9
Name: chaud
Date: June 7, 2004 at 05:06:34 Pacific
Subject: Display IP through PHP
Reply: (edit)
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.


Report Offensive Follow Up For Removal

Response Number 10
Name: dzunnea
Date: July 14, 2004 at 09:55:23 Pacific
Subject: Display IP through PHP
Reply: (edit)
I've found this on google Tracemyip.ph have a look.

Report Offensive Follow Up For Removal



Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Display IP through PHP

Comments:

 
  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 


Data Recovery Software




XP Installed to G?

exessive internet traffic

ZoneAlarm Question. Blocked Connect

Windows Live Messenger Problem

Delete $Uninstall after SP3 updates


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

All content ©1996-2007 Computing.Net, LLC