473,480 Members | 4,852 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

How to format webpage by geo location?

I've been told that I can make which page shows based on IP address and have seen examples, but never seen any corresponding code. (The company is a franchise and they want the website to show the correct state franchises they are viewed in)

Has anyone done this before?
Oct 1 '10 #1
2 1294
dlite922
1,584 Recognized Expert Top Contributor
You need a subscription for geolocation database or Web API.

Then use submit your user's IP address, they return the info to you usually including country, state, long/lat, area code, etc.

Here's an example that no longer works:
http://www.codediesel.com/tools/free...tion-api-tool/

If you google: PHP Geolocation, you'll get some hits.

Cheers,

Dan
Oct 1 '10 #2
Shenno
59 New Member
i think each country have fixed ip addresses range which u can easly test using if.

then u can include content according to ip address u got..

Expand|Select|Wrap|Line Numbers
  1. if($_SERVER["REMOTE_ADDR"] == " /* COUNTRY IP */")
  2. {
  3. include("specific_content.php"):
  4. }
  5.  
  6.  
u can get that fixed ip addresses using lovely GOOGLE =)


hope that helps.
Oct 2 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
23922
by: Brian Genisio | last post by:
What is the most reliable way to grab the URL base for a document? I can get window.location.protocol + window.location.host + window.location.path... and that would work most the time, but if...
13
2050
by: Will Pittenger | last post by:
I have a Control derived class. When the parent of the control changes the control's Location property, the stack overflows. I have not found a way to find out what was on the stack when it does...
6
6647
by: Microsoft | last post by:
Base class: class AssetBase { string _clli; public string CLLI { get
7
6591
by: Baski | last post by:
Base class: class AssetBase { string _clli; public string CLLI { get
1
2034
by: Andrew Venmore | last post by:
Hello, I have a base dialog form with a panel docked to the bottom with an OK and a Cancel button in it (all Modifiers=Protected, buttons' Anchor=Top,Right). At design time the size of the base...
8
3472
by: Brett Romero | last post by:
I have this situation: myEXE <needs< DerivedClass <which needs< BaseClass Meaning, myEXE is using a type defined in DerivedClass, which inherits from BaseClass. I include a reference to...
0
818
by: Antoon Pardon | last post by:
When you want to specify a location or moment, it sometimes is easier to do so in an absolute way and sometimes it is easier to do so relative to some kind of base. Examples of this are the...
0
2111
by: robert | last post by:
Hi all, I'm having a hard time resolving a namespace issue in my wsdl. Here's an element that explains my question, with the full wsdl below: <definitions name="MaragatoService"...
1
1702
by: Choronzon | last post by:
I have a player table, which is made up of fields: id SERIAL NOTNULL AUTO_INCREMENT (this is the primary key, auto increment so each player is assigned a unique key) player VARCHAR (just a...
4
1648
by: David Williams | last post by:
I am familiar with creating custom configuration settings and accessing them. However, for a current requirement, I need to control the various settings in my custom configuration section by...
0
7040
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7041
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7080
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6736
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
6908
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5331
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4772
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
2994
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
2980
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.