[SOLVED] Whats my ip?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
NeoPuma
Forum Commoner
Posts: 26
Joined: Sat Mar 06, 2004 12:18 pm
Location: South Wales, UK
Contact:

[SOLVED] Whats my ip?

Post by NeoPuma »

Hi there,
I once seem it on a script, but i lost it. But any way, whats the code to display the IP of the viewer? Also i wish to put it in a text box...

-Neo
Illusionist
Forum Regular
Posts: 903
Joined: Mon Jan 12, 2004 9:32 pm

Post by Illusionist »

Code: Select all

echo $_SERVER['REMOTE_ADDR'];
to put it in a textbox:

Code: Select all

$ip = $_SERVER['REMOTE_ADDR'];
echo "<input type="text" name="ip" value="$ip">";
NeoPuma
Forum Commoner
Posts: 26
Joined: Sat Mar 06, 2004 12:18 pm
Location: South Wales, UK
Contact:

Post by NeoPuma »

ty
Post Reply