I am trying to simply set a variable and have it passed back to the same PHP script as called, however it doesn't work.
The first time the script is run I see what I expect to see on screen which is
Your store is USA and your language is en
If I then choose UK and press submit I see the following line
Your store is and your language is en
My sample code is
<?php
if(isset($_POST['submit'])){
$store = $_GET['store'];
$lang=en;
}
else
{
$store=143441;
$lang=en;
}
switch ($store)
{
case "143441":
$storename="USA";
break;
case "143444":
$storename="UK";
break;
}
?>
<head>
</head>
<body>
<form name="store" method="post" action="test.php">
<select name="Store">
<option value="143441">USA</option>
<option value="143444">UK</option>
</select>
<INPUT TYPE="submit" name="submit" value="submit">
</form>
<?php echo "Your store is " . $storename . " and your language is " . $lang; ?>
</body>
</html>