Passing parameters back to same form using PHP

Allequeinsali

New Member
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\[quote\] Your store is USA and your language is en\[/quote\]If I then choose UK and press submit I see the following line\[quote\] Your store is and your language is en\[/quote\]My sample code is\[code\]<?phpif(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="http://stackoverflow.com/questions/3837942/143441">USA</option><option value="http://stackoverflow.com/questions/3837942/143444">UK</option></select><INPUT TYPE="submit" name="submit" value="http://stackoverflow.com/questions/3837942/submit"></form><?php echo "Your store is " . $storename . " and your language is " . $lang; ?></body></html>\[/code\]
 
Back
Top