A little example: (try it in
http://fpepito.dyndns.org/test.php)
I hope that help you,
pepito
-----------------
<?
$myname = $PHP_SELF;
session_register ("session");
if (isset ($session[lang])) {
// if user choice another language, update the session[lang]
if (isset ($lg)) { $session[lang] = $lg;}
echo "Session existe, you have enter: $session[count] times<BR>";
echo "Your actual language is: $session[lang]<BR>";
setlocale ("LC_TIME", $session[lang]);
echo strftime ("%c")."<BR>";
// You need locale file corresponding with the next language
echo "<A HREF=$myname?lg=fr_FR>Utiliser le français</A><BR>";
echo "<A HREF=$myname?lg=en>Use english langage</A><BR>";
echo "<A HREF=$myname?lg=pt_PT>Utilizar o portugues</A><BR>";
// update counter
$session[count] = $session[count] + 1;
} else {
echo "It's the first time that you coming. We will create session:<BR>";
$session[lang] = $HTTP_ACCEPT_LANGUAGE;
$session[count] = 1;
echo "<A HREF=$myname>reload</A>";
}
?>