I have some code to change my language depending on session
Here is my php code
function make_lang(){
session_start();
if(isset($_POST['a'])){
$_SESSION['a']=true;
unset ($_SESSION['e']);
unset ($_SESSION['f']);
}
if(isset($_POST['e'])){
$_SESSION['e']=true;
unset ($_SESSION['a']);
unset ($_SESSION['f']);
}
if(isset($_POST['f'])){
$_SESSION['f']=true;
unset ($_SESSION['e']);
unset ($_SESSION['a']);
}
}
function lang_path(){
if(!isset($_SESSION['e']) or !isset($_SESSION['f'])){
include('lan/a.php');
echo '<link rel="stylesheet" type="text/css" href="css/style-z.php" />';
}
if(isset($_SESSION['a'])){
$lang = "a";
}
if(isset($_SESSION['e'])){
$lang = "e";
}
if(isset($_SESSION['f'])){
$lang = "f";
}
$path="lan/".$lang.".php";
return $path;
}
function lang_css(){
if(isset($_SESSION['a'])){
$css = "style-z";
}
if(isset($_SESSION['e'])){
$css = "style-zleft";
}
if(isset($_SESSION['f'])){
$css = "style-zleft";
}
$css_i="css/".$css.".css";
return $css_i;
}
make_lang();
$l_file = lang_path();
include($l_file);
$l_css = lang_css();
echo '<link rel="stylesheet" type="text/css" href="'.$l_css.'" />';
html form
<form method="post" class="login-img">
<input name="e" type="submit" value="English" class="login-img" />
<input name="a" type="submit" value="Arabic" class="login-img" />
<input name="f" type="submit" value="Frinch" class="login-img" />
</form>
The problem is
When you click on any hyperlink on the site does not work the code, but in the case of pressing a button language site appears well But in the case of pressure on any other hyperlink does not work well site
Web site link: http://www.hh4track.com/
Thanks for helping.