•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 361,560 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,012 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 284 | Replies: 3
![]() |
•
•
Join Date: May 2008
Location: Hyderabad,India
Posts: 89
Reputation:
Rep Power: 1
Solved Threads: 0
Hi,
Can I change the information of a site depending on ip address.
For example:
I have different folders for each geographic location, say for USA it should show a different site, for UK it should show a different site, like wise depending on the IP address it should go to that particular folder or index file.
Is tht possible using php?
Can I change the information of a site depending on ip address.
For example:
I have different folders for each geographic location, say for USA it should show a different site, for UK it should show a different site, like wise depending on the IP address it should go to that particular folder or index file.
Is tht possible using php?
Suhasini
•
•
Join Date: May 2008
Posts: 31
Reputation:
Rep Power: 1
Solved Threads: 5
•
•
•
•
Hi,
Can I change the information of a site depending on ip address.
For example:
I have different folders for each geographic location, say for USA it should show a different site, for UK it should show a different site, like wise depending on the IP address it should go to that particular folder or index file.
Is tht possible using php?
There are two ways of doing this. One is to buy the MaxMind database, another is to do whois calls using a socket (not through their web interface!) and cache the netblock results so you don't hammer whois and get yourself banned.
-r
•
•
Join Date: May 2008
Location: Hyderabad,India
Posts: 89
Reputation:
Rep Power: 1
Solved Threads: 0
•
•
Join Date: May 2008
Posts: 31
Reputation:
Rep Power: 1
Solved Threads: 5
you can parse country information from whois response. the various ip authorities have different record formats so you have some work ahead of you.
ARIN will tell you if you need to go to another authority. Look for the Referral Server field. The presence of this field indicates that the record is delegated.
Also look for and follow referral records to the final netblock record. if you get a record with nothing but netblocks, the smallest netblock is the one you need to search for the whois record on to get the information. These referral records are created by ISP's who sublet chunks of their IP allocation.
If you aren't familiar with text parsing and especially IP address calculations, working with whois, and need to do this in a hurry, I'd buy the database. It's a *lot* easier. They have a trial database so you can demo it. Just make sure you use IP's in the trial database for demo.
ARIN will tell you if you need to go to another authority. Look for the Referral Server field. The presence of this field indicates that the record is delegated.
Also look for and follow referral records to the final netblock record. if you get a record with nothing but netblocks, the smallest netblock is the one you need to search for the whois record on to get the information. These referral records are created by ISP's who sublet chunks of their IP allocation.
If you aren't familiar with text parsing and especially IP address calculations, working with whois, and need to do this in a hurry, I'd buy the database. It's a *lot* easier. They have a trial database so you can demo it. Just make sure you use IP's in the trial database for demo.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb PHP Marketplace
Similar Threads
- Premium Domains $2000 - $15000 (Domain Names for Sale)
- This Should be Easy for You Guys! (Linux Servers and Apache)
- Googles Patent is out (Search Engine Optimization)
- another newbie with alot of redhat and apache server Q'S (Linux Servers and Apache)
- GET! GOT! GOTCHA! I still don't Get it... (C++)
- This ought to be simple - extra spaces (PHP)
Other Threads in the PHP Forum
- Previous Thread: Help with regular expression please
- Next Thread: Profile Help needed


Linear Mode