Please help to check my index.php work?

Discussion in 'HTML & Website Design' started by similikiti65, Aug 2, 2009.

  1. #1
    I have site www.evodie-art.com, this site was made by myself with no experience in site development. To increase accessibility, I use multiple server in USA, Germany, and Singapore using index.php:

    <?php
    $country = geoip_country_code_by_name($_SERVER["REMOTE_ADDR"]);
    if ($country == "ID") {
    echo"<script language='javascript'>location.href='http://www.evodie-art.com/index.html';</script>";
    } else if ($country == "US") {
    echo"<script language='javascript'>location.href='http://us.evodie-art.com/index.html';</script>";
    } else if ($country == "SG") {
    echo"<script language='javascript'>location.href='http://sg.evodie-art.com/index.html';</script>";
    } else if ($country == "DE") {
    echo"<script language='javascript'>location.href='http://eu.evodie-art.com/index.html';</script>";
    } else {
    echo"<script language='javascript'>location.href='http://www.evodie-art.com/index.html';</script>";
    }
    ?>

    How do I know that index.php work correctly?
     
    similikiti65, Aug 2, 2009 IP
  2. alfa_375

    alfa_375 Active Member

    Messages:
    445
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #2
    you can track your visitor by google analytic or something with geo location of the visitor.
     
    alfa_375, Aug 3, 2009 IP
  3. AssistantX

    AssistantX Peon

    Messages:
    173
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #3
    To test your page, input different IP addresses from different countries instead of using $_SERVER["REMOTE_ADDR"]. This will tell you if your script changes to your desired website properly. Then test $_SERVER["REMOTE_ADDR"] itself to make sure it gets the user's IP and not your web host's (With some web hosts, you must bypass their proxy). Check $_SERVER["REMOTE_ADDR"] and make sure it atleast gets your IP correctly.
     
    AssistantX, Aug 3, 2009 IP
  4. champion510

    champion510 Member

    Messages:
    379
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    35
    #4
    Use Google Analytics. it's more than enough. easy to use and track.
     
    champion510, Aug 3, 2009 IP