Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: Identifying IP address location

  1. #1
    Senior Member gprit's Avatar
    Join Date
    Dec 2010
    Location
    South Wales, UK
    Posts
    360

    Default Identifying IP address location

    I want to have a variant of my website that will display prices in a different currency (one for GBP and the other for euro).
    Don't want to insert any drop down currency options.

    Anyone know what code is needed to be inserted so that eg if IP address is located in France then direct to French version, else to English version?

  2. #2
    Senior Member Since_v4's Avatar
    Join Date
    Mar 2014
    Location
    Caribbean
    Posts
    607

    Default

    You may have problems with shipping costs.

    You will get an IP that shows France but in fact the buyer is in Martinique, French Overseas Territory.

    If the buyer is in St. Barths, another French Overseas Territory, there is another shipping cost because it is a small island and items must go first to a (big) island and re-distributed.

    I wonder how long the maintenance time for you to deal with new issues will be.
    John - The secret of life is a better life.
    For NOF beginners: read everything here and practice on mock web sites first.
    Before asking a question, search to see if it has not been asked and answered already.

  3. #3
    Senior Member gprit's Avatar
    Join Date
    Dec 2010
    Location
    South Wales, UK
    Posts
    360

    Default

    Shpping costs are not an issue...it is website development......
    SHipping costs/other currencies could be dealt with as in my other ecommerce site www.thegiftshop.tv (Zencart!)

  4. #4
    Senior Member gotFusion's Avatar
    Join Date
    Jan 2010
    Location
    www.gotHosting.biz - - - - - - - - - - - www.gotFusion.com
    Posts
    4,452

    Default

    https://www.w3.org/International/que...t-lang-locales

    There are scripts that will do this a lot better.
    NetObjects Fusion Cloud Linux enabled Web Hosting, support + training starts at $14.95
    NetObjects Fusion web Hosting and support + ASP + PHP + ColdFusion + MySQL + MS SQL
    FREE Fusion Support & training comes with all web hosting accounts
    NetObjects Fusion Support: http://www.gotFusion.com
    NetObjects Fusion Hosting: http://www.gotHosting.biz

  5. #5
    Senior Member gprit's Avatar
    Join Date
    Dec 2010
    Location
    South Wales, UK
    Posts
    360

    Default

    Thanks for that pointer.....I don't actually see any examples (even Wikipedia)where to use this to detect the IP Address loccation though.
    Not requiring to set language alternatives on website.
    My target is English speaking people who are living in France....hence they will have a French IP address, and the website will still be in English.
    They would however be directed to (english) site that displays prices in euro rather than GBP.)

  6. #6
    Senior Member gprit's Avatar
    Join Date
    Dec 2010
    Location
    South Wales, UK
    Posts
    360

    Default

    Still trying to resolve this.....It seems that it cannot be done using html.....but needs to be in a programming language such as PHP.

    The following script gets lots of information about the visitor......but my question now is how do I trigger the PHP file from within NOF website?

    // get user details
    $user_agent = $_SERVER['HTTP_USER_AGENT']; //user browser
    $ip_address = $_SERVER["REMOTE_ADDR"]; // user ip adderss
    $page_name = $_SERVER["SCRIPT_NAME"]; // page the user looking
    $query_string = $_SERVER["QUERY_STRING"]; // what query he used
    $current_page = $page_name."?".$query_string;


    // get location
    $url = json_decode(file_get_contents("http://api.ipinfodb.com/v3/ip-city/?key=/*userapikey*/
    // you can get your api key form http://ipinfodb.com/
    ip=".$_SERVER['REMOTE_ADDR']."&format=json"));
    $country=$url->countryName; // user country
    $city=$url->cityName; // city
    $region=$url->regionName; // regoin
    $latitude=$url->latitude; //lat and lon
    $longitude=$url->longitude;

    // get time
    date_default_timezone_set('UTC');
    $date = date("Y-m-d");
    $time = date("H:i:s");

  7. #7

    Default

    Quote Originally Posted by gprit View Post
    ......but my question now is how do I trigger the PHP file from within NOF website?
    Site View > Page Properties > Custom Names > File Extension
    Choose php.

    What is html still acts like html.

    You must also have php installed at your server. The php won't 'activate' in Local publish. Only works at the server.
    Never trust a skinny chef

  8. #8
    Senior Member gotFusion's Avatar
    Join Date
    Jan 2010
    Location
    www.gotHosting.biz - - - - - - - - - - - www.gotFusion.com
    Posts
    4,452

    Default

    Quote Originally Posted by Beach Ape View Post
    Site View > Page Properties > Custom Names > File Extension
    Choose php.
    Here is a tutorial that explains this in step by step for the OP

    http://www.gotfusion.com/tutorials/t...mID=242#custom
    NetObjects Fusion Cloud Linux enabled Web Hosting, support + training starts at $14.95
    NetObjects Fusion web Hosting and support + ASP + PHP + ColdFusion + MySQL + MS SQL
    FREE Fusion Support & training comes with all web hosting accounts
    NetObjects Fusion Support: http://www.gotFusion.com
    NetObjects Fusion Hosting: http://www.gotHosting.biz

  9. #9
    Senior Member gprit's Avatar
    Join Date
    Dec 2010
    Location
    South Wales, UK
    Posts
    360

    Default

    Maybe I am a bit dim here.....but I don't see this achieves what I want to do........

  10. #10

    Default

    Quote Originally Posted by gprit View Post
    Maybe I am a bit dim here.....but I don't see this achieves what I want to do........
    Having your page set to the .php extension and having php installed on your server are the only ingredients needed for a php script to run.

    It appears this only leaves your needing support from the script writers to 'invoke' some sort of action.
    Never trust a skinny chef

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •