http://www.sitepoint.com/forums/show...=1#post3158142
Sorry, in relation to the above post, this is the solution that works well for what I need: -
English is the default, so if cookies are disabled, as tested earlier, or no cookie is set, or present, then move on to test for the HTTP lang dir. The browser redirects according to this prefs. But if the lang prefs are not french, then just redirect to English.PHP Code:<?php
if ($_COOKIE["lang"] == "French")
{
header( 'Location: http://www.french.com' ) ;
}
elseif ($_COOKIE["lang"] == "English") {
header( 'Location: http://www.english.com' ) ;
}
elseif (substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2) == 'fr')
{header( 'Location: http://www.french.com' ) ;}
else
{header( 'Location: http://www.english.com' ) ;}
?>
Hope this helps anyone



Bookmarks