Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> User Ip And City Tracing In Php, User IP and City Tracing in PHP
arunkumarhg
post Dec 21 2004, 12:41 PM
Post #1


Advanced Member
Group Icon

Group: Members
Posts: 135
Joined: 29-November 04
From: Bangalore, India
Member No.: 1,559



Hi,

Am in damm need of tracing the Users IP and City hwre they are from with PHP,
Any help please.......


Thanks in Advance
Arunkumar.H.G
Go to the top of the page
 
+Quote Post
jipman
post Dec 21 2004, 03:44 PM
Post #2


Pretty please?
Group Icon

Group: Members
Posts: 733
Joined: 28-November 04
From: Holland
Member No.: 1,552



IP is easy if you mean the client that connects to your server has to be logged.

$adress = $_SERVER['REMOTE_ADDR'];

insert that line and the variable $adress will be the IP you need.

But city is not possible i think, because the IP only refers to the company that has registered the subnet ( first 3 digits of you ip). So you can only find out who someones ISP is. And in wich country someone is. All you need to do is a whois to the ip you just got.
Go to the top of the page
 
+Quote Post
cryptwizard
post Dec 21 2004, 08:47 PM
Post #3


Member - Active Contributor
Group Icon

Group: Members
Posts: 77
Joined: 11-December 04
Member No.: 1,704



To get a host name (something like xxx.70.233.220.exetel.com.au) run the IP address through gethostbyaddr($ip).
Like jipman said the IP address is accessible through $_SERVER['REMOTE_ADDR'].

To get their contury, there's an API here:
http://sourceforge.net/projects/geoip/
I never used it myself, but I've seen it in use on mySQL.com and it works for me.
It has APIs for a wide variety of languages.

Hope that helps.
Go to the top of the page
 
+Quote Post
arunkumarhg
post Dec 22 2004, 11:22 AM
Post #4


Advanced Member
Group Icon

Group: Members
Posts: 135
Joined: 29-November 04
From: Bangalore, India
Member No.: 1,559



Thanks for your reply,
recently i gone through the http://www.ip2location.com/ there they will display even city also, how it is done. Any links resources please....

Regards
Arunkumar.H.G
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Secret Behind Your Nick/User Names(128)
  2. Which Distro Of Linux Is Best For A Windows User ?(42)
  3. Laptop Hangs When Loading User (xp)(6)
  4. Get User Input From Vbscript For Batch Files(2)
  5. How To Reset The Server Variable Php_auth_user(9)
  6. User Authentication Session Handling Problems(14)
  7. How Can I Make Xp User Autologin ?(6)
  8. Simple User Validation Script(5)
  9. Gimp: Good User Bar Creator(14)
  10. City By The Night Vector Wallpaper(7)
  11. My Summary Of Vista Bugs(12)
  12. Graphcal User Interfaces In Java(4)
  13. Torn City(9)
  14. Make A Script Run Even If No User Is Online(6)
  15. Tracing Broadcast Storms(1)
  1. Bblean(0)
  2. How To Create/edit/delete Ftp Accounts With Php(2)
  3. How To Create A "user Profile" Page.(14)
  4. I Really Need Help(5)
  5. Mysql And User File_priv(0)
  6. How To: Display A Members/user List.(3)
  7. Yahoo! Messenger Power User(2)
  8. User Account Control(13)
  9. City Of Heroes Review.(1)
  10. How To Change Your Windows User Environment Variables(5)
  11. How To Enable User Login Security On Windows Vista(0)
  12. [report] A User(1)
  13. Javascript Keyevents ?(3)


 



- Lo-Fi Version Time is now: 2nd December 2008 - 01:02 AM