Welcome to Geeklog, Anonymous Saturday, December 21 2024 @ 08:58 am EST

Geeklog Forums

Static Pages: Display user's IP address


Chrispcritters

Anonymous
I'm trying to create a static page that will display the user's IP address. For some reason the PHP code only returns the IP address of the server itself. Is there a way around this?
 Quote

Status: offline

Dirk

Site Admin
Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
Use $_SERVER['REMOTE_ADDR']

bye, Dirk
 Quote

Chrispcritters

Anonymous
For some reason that returned the server IP address. Solved it be using the following (just used phpinfo() to see what returned what within the PHP static page):

echo getenv("HTTP_PC_REMOTE_ADDR");

Thanks!
 Quote

All times are EST. The time is now 08:58 am.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content