i'm trying to make my site with a few languages. Every page includes config-file, wich checks variable 'lang' in session. If it doesn't exist, wi'll be redirected to the page of lang choosing. After choosing u'll come to the page before. But it works only in Mozilla Firefox. In other browser after language checking i always get this page (lang checking). What i did wrong? Config-file:
// Here is session start...
if (!isset($_SESSION['site_lang']))
{
$_SESSION['page_refer'] = "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI'];
echo '<meta http-equiv="Refresh" content="0; URL=lang_choose.php">';
exit;
}
else
{
require_once 'languages/'.$lang.'.php';
}
?>
lang_choose.php:
// Session start
@extract($_POST);
if (isset($_POST['lang']))
{
$lang = $_POST['lang']; $lang = replace($lang);
$_SESSION['site_lang'] = $lang;
echo '<meta http-equiv="Refresh" content="0; URL='.$_SESSION['page_refer'].'">';
}
else
{
// Showing form with flags... which returns var 'lang'
}
EDIT: If there is
< input type="image" src="img/langs/en.png" width="290" height="200" border="1" name="lang" value="en" />
in form it doesn't work in another browsers (except mozilla) but if i use:
< input type="submit" name="lang" value="en" />
Her şey iyi. Herhangi bir fikir?
Teşekkürler.