software development


I added this language based redirect below on my page, yet $HTTP_ACCEPT_LANGUAGE keeps reading the language as English (even after I change the browser language). A friend tossed the same php on a site that was hosted by Yahoo and it worked perfectly. I’m sure I’m missing something dead simple, but I just can’t figure out what I’m doing wrong. Any and all help is appreciated.

<?php $lang=strtok($HTTP_ACCEPT_LANGUAGE,","); if ($lang == "fr") { header("Location: /france.htm"); } ?>


Yes. For security reasons DreamHost has “register globals” turned off.

You should be using $_SERVER[‘HTTP_ACCEPT_LANGUAGE’] instead. See for exampe http://phpinfo.dreamhosters.com/phpinfo.php (scroll all the way down to PHP Variables)

:cool: openvein.org -//-


Thank you so much. That works perfectly!!!