PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 23rd, 2012, 11:52 PM
paramjit999 paramjit999 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 2 paramjit999 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 48 sec
Reputation Power: 0
PHP-General - Resolve IP Address

I am using
$IP=gethostbyaddr($_SERVER['REMOTE_ADDR']);

to get the ip address of the user but some times iam getting an ip address as following

089-100-174051.ntlworld.ie

what does this ip address means and how can i resolve it?

i found one link which resolves it on
webyield.net

but i need to do it an script as i need to map ip address to country.

Can anyone help in resolving the ip address using php script.

Thanks.

Reply With Quote
  #2  
Old November 24th, 2012, 06:40 AM
ttremain ttremain is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2005
Location: Vancouver, WA, USA
Posts: 364 ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level)ttremain User rank is First Lieutenant (10000 - 20000 Reputation Level) 
Time spent in forums: 3 Days 7 h 49 m 59 sec
Reputation Power: 188
To get the IP, just use:

Code:
$IP=$_SERVER['REMOTE_ADDR']; 


(Works in MOST cases, but there are exceptions)

gethostbyaddr() resolves the IP to a hostname, using Reverse DNS
__________________
Thomas Tremain

Reply With Quote
  #3  
Old November 25th, 2012, 10:32 PM
paramjit999 paramjit999 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 2 paramjit999 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 48 sec
Reputation Power: 0
Thanks for that information.will check it out.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > PHP-General - Resolve IP Address

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap