some progress, maybe....
this is part of the code to login with the ability to choose language:
// start session
session_start();
// convert username and password from _POST or _SESSION
if($_POST["username"])
{
$username=$_POST["username"];
$password=$_POST["password"];
$lang=$_POST["lang"];
}
elseif($_SESSION["username"])
{
$username=$_SESSION["username"];
$password=$_SESSION["password"];
$lang=$_SESSION["lang"];
}
// start and register session variables
session_register("username");
session_register("password");
session_register("lang");
after this they are suppose to see the texts on menu.php according to the language they have chosen when they logged in BUT the language texts are empty! however they will see the form to choose language and when they click on english or italian or spanish, they get the desired texts!
here part of the code on top of menu.php with the language change option
<?
session_start();
// Register session key with the value
$_SESSION['username'] = $username;
$_SESSION['lang'] = $_POST['lang'];
// start with setting the language
if ($lang == 'eng')
{
include"lang/eng.php";
}
elseif ($lang == 'ita')
{
include"lang/ita.php";
}
elseif ($lang == 'spa')
{
include"lang/spa.php";
}
elseif ($lang == 'pol')
{
include"lang/pol.php";
}
// end of setting language
?>
<form action="menu.php" target="_self" method="post">
<SELECT id=lang name="lang">
<option value=eng>English</option>
<option value=ita>Italian</option>
<option value=spa>Espanol</option>
<option value=pol>Polski</option>
</SELECT>
<input type="submit" value="Submit" name="submit">
</form>
also another thing when they click their desired language they see the text in that language but on the form , the selected valed remains english, i want that when they choose another language that will also be the default on the form.
thanks.