Hello, I am trying to have a iframe of http://domain.tld/ads/index.php and i want index.php to redirect to http://domain.tld/ads/USA/index.php if in the USA and http://domain.tld/ads/AU/index.php if in Australia and http://domain.tld/ads/WW/index.php if not in Australia or USA. How can i do this? Please Help Thank's
You can use MaxMind's GeoLiteCountry. I made a really simply geo targeting tutorial a while ago here: http://www.thewebsiteprofessionals.com/geo-targeting.html I use it on heaps of sites and it works well. It's all PHP (no JS).
Use method above to get the country the guy is from, then with simple IF statement make a conditional like: if($country = "USA") { header("Location: http://domain.tld/ads/USA/index.php"); } Code (markup): header() is a function that sends browsers headers (in this case, redirects to USA URL), please note that you have to place this before output is echoed/printed. Hope this helps, cheers