1,105,384 Community Members

Code to redirect a site visitor based on location...

Member Avatar
JiminSA
Newbie Poster
2 posts since Apr 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi there!
I have just joined DaniWeb and would like to pose a question...
I need to direct my UK visitors to a Special Homepage, does anyone know of some simple PHP or even Javascript code that will point me in the right direction?

Member Avatar
colweb
Posting Whiz
316 posts since Nov 2007
Reputation Points: 13 [?]
Q&As Helped to Solve: 53 [?]
Skill Endorsements: 0 [?]
 
0
 

Welcome.

You may want to look here http://www.phptutorial.info/iptocountry/the_script.html They explain how country identification works and have ready to use php online. In the response from users section, (http://www.phptutorial.info/iptocountry/responses.html) the second question and answer is exactly what you are looking for.

Member Avatar
JiminSA
Newbie Poster
2 posts since Apr 2010
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Brilliant! - Thank you so much!

Question Answered as of 3 Years Ago by colweb
asaasdasdd
Newbie Poster
1 post since Dec 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
0
 

thanks that helped me....

Member Avatar
varunr
Newbie Poster
1 post since Aug 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
-1
 

hello

you can set these location based redirects and implement it easily into your website by using Geolify's geo redirect tools.

Have a look at http://geolify.com

sign up for their service and create a geo redirect.

you can enter, the visitor location, landing url, redirect url and you will get 1 line of simple java code which you paste in between your website's HEAD tags and the location based redirect will become active.

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article