hi there!
please dont be angry about the strange header, its just to make a search for it easier..
before you think of it: i already searched but couldnt get to work what i found!
so this is my problem:
i want a select form to show the selected item after the form is submitted (targeting itself)... but only strange things happen.
this is the code: (dont cry over it, its dirty and cheap and possibly full of error... it a patchwork code 😉
if (isset($selit))
{
echo '<FORM ACTION="test.php" METHOD=POST>';
$cc[]='1';
$cc[]='2';
$cc[]='3';
echo '<select NAME="selit">';
echo "<option value=>select one";
for ($i=0; $i < sizeof($cc); $i++);
{
$sel=$cc[$i];
if ($sel == $selit) {
$sel = $sel.' selected';
echo $sel;
}
$temp= $cc[$i]>$cc[$i];
// $temp = $cc[$i];
echo $temp;
echo '<option '.$sel.' value= "'.$temp.'">';
echo "</option>";
}
}
else {
echo '<FORM ACTION="test.php" METHOD=POST>';
echo '<select NAME="selit">';
echo '<option value="1" selected>1</option>';
echo '<option value="2">2</option>';
echo '<option value="3">3</option>';
}
echo '</select>';
echo '<INPUT TYPE="submit">';
echo '</FORM>';