PHP & JavaScript IP Redirect Help

Discussion in 'HTML & Website Design' started by ChristopherLeeMaher.Com, May 13, 2010.

  1. #1
    ChristopherLeeMaher.Com, May 13, 2010 IP
  2. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #2
    Kerosene, May 13, 2010 IP
  3. devgex.com

    devgex.com Well-Known Member

    Messages:
    193
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    133
    #3
    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
     
    devgex.com, May 13, 2010 IP