Redirecting based on the visitor's country

Discussion in 'PHP' started by Seqqa, May 9, 2008.

  1. #1
    Hello Everyone,

    I would like to send my visitors to different pages on my website I would like to send USA IP's to say for example page_1.htm and IP's from everywhere else to page_2.htm

    Just wanted to know if there was a PHP code out there that would do the job, green rep for anybody that posts a code that works.
     
    Seqqa, May 9, 2008 IP
  2. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #2
    jayshah, May 9, 2008 IP
  3. Alexj17

    Alexj17 Member

    Messages:
    173
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #3
    Its not just as simple as PHP code, to do the job more efficiently a database is required.
     
    Alexj17, May 9, 2008 IP
  4. jayshah

    jayshah Peon

    Messages:
    1,126
    Likes Received:
    68
    Best Answers:
    1
    Trophy Points:
    0
    #4
    Depending on the size of the data, the database will slow down the process. MaxMind provide a binary version of their database, which is quicker, than importing an equivalent database of it. That's also why they provide the sample PHP code.

    Jay
     
    jayshah, May 10, 2008 IP
  5. Seqqa

    Seqqa Well-Known Member

    Messages:
    3,695
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    115
    #5
    Right ok, and how would this all work?
     
    Seqqa, May 10, 2008 IP