• Hello,

    I am wondering if it is possible to create a site that depending on which country the visitor is accessing the site from a pages changes. So in other words I want there to be a different contact page depending on which country the website is being accessed from. Is this possible?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hmm…if you are a newbie to wordpress..i guess it might be very difficult to do this..

    E.g

    you’ll have to get the visitors ip…know from which country its from..then show your page according to his location…thats just an idea…

    btw have you ever used webmastertools…and y on earth do you need that anyway ?

    Thread Starter seamusdoone2

    (@seamusdoone2)

    Thank you for your response. I have not used web master tools. This is a good idea I need it to be automatic. I simply want my contact page to adjust to each location because it would be good for my site and goals.

    I think the only way to do this is to code your site and filter the visitors by ip but i don’t know how to do this or how safe it will be.

    Thread Starter seamusdoone2

    (@seamusdoone2)

    Thank you for responding. How would doing this be unsafe?

    I don’t know if the algorithms+ips are filtering correctly but i am not an expert on the subject + i don’t have any experience in any of my sites.

    Thread Starter seamusdoone2

    (@seamusdoone2)

    Ok, well thank you for your response

    function getIp() {
    
            $ip = $_SERVER['REMOTE_ADDR'];
    
            if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
    
                $ip = $_SERVER['HTTP_CLIENT_IP'];
    
            } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
    
                $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
    
            }
    
            return $ip;
    
        }
    echo "Remote addr: " . $_SERVER['REMOTE_ADDR']."<br/>";
    
    echo "X Forward: " . $_SERVER['HTTP_X_FORWARDED_FOR']."<br/>";
    
    echo "Clien IP: " . $_SERVER['HTTP_CLIENT_IP']."<br/>";

    You can use this to get the user ip..hopefully the good one

    Because the values of the X-Forwarded-For and Client-Ip are not reliable.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘International Websites’ is closed to new replies.