views:

7

answers:

1

Hi. I have a code like this that extract the country code saved in the cookie.

        if (isset($_COOKIE['country'])) 
            {
                $country = $_COOKIE['country'];

                    $language = "eng";

                if ($country == "NO"){              
                    $language = "nor";
                    }                       
                }
            else
            {
            $language = "eng";
            }

Now I need to append the language from the $supported_locales = array('en_US', 'no_NO');

and append it to the url so it looks like this http://localhost/site/test.php?lang=no_NO

How do I do that?

+1  A: 
header('Location: http://localhost/site/test.php?lang='.$language);  

or

echo '<script>location.href="http://localhost/site/test.php?lang='.$language.'"&lt;/script&gt;';
Luis Junior