PHP code not working on IE
- by Michael Frey
I have a website with a flag. If it is clicked, the language of the website changes.
Here is the code displaying the flag, which is a form with post event:
<?php
$pagename = $_SERVER['REQUEST_URI'];
echo '<form action="'.$pagename.'" method="post">
<input name="formlanguage" type="image" ';
if ($_SESSION['lang'] == 0)
{
echo 'alt="English" src="images/en.png" value="1" ';
}
else
{
echo 'alt="Deutsch" src="images/de.png" value="0" ';
}
echo '/></form>';
?>
Here is the response to that, and this part always fails on IE:
if (isset($_POST['formlanguage']))
{
$_SESSION['lang']=$_POST['formlanguage'];
}
I can not figure out why it works on Chrome but not IE. I assume that it might be a setting of IE. But what could that be?