How do i get the IP f a user?

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
iceangel89
Forum Commoner
Posts: 39
Joined: Mon Jul 02, 2007 7:02 pm

How do i get the IP f a user?

Post by iceangel89 »

How do i get the IP f a user? and maybe country info? like USA, Singapore etc
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

You can't reliably get the ip address.

$_SERVER['REMOTE_ADDR'] will give you it, if it is available. You can find the other information using geoip databases or services.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply