Now I have the following code :
[php]$options = array (
12 => 12,
24 => 24,
36 => 36,
48 => 48
);
echo"<form name = 'form' action = 'indexbody.php' method = 'GET'>
<select name='amount'>";
foreach($options as $key => $value)
{
$selected = $_GET['amount'] == $key ? 'selected' : '';
if($key == 24 && !$_GET['amount'])
$selected = 'selected';
echo"<option value = '".$key."' ".$selected.">".$value."</option>";
}
echo"</select>
<input type = 'submit' name = 'submit' value = 'zend'>
</form>";
if($_GET['submit'])
echo "test: ".$_GET['amount'];[/php]
If I click on the value 36 in the dropdown list and I go to the next page, the value of the dropdown list should stay 36. But it changes back to 24. What should I do ?