Forum Moderators: coopster
I've got something I cant work out - probably just syntax troubles:
I've got this condition:
<select name="adults">
<? for ($i = 1; $i <= 10; $i++)
{
echo ('<option value="' . $i . '"');
if (isset($_SESSION['adults']) && $_SESSION['adults'] == $i)
{
echo (' selected');
}
echo ('>'. $i . '</option>');
}?>
</select>
Problem is that the condition never evaluates to true even though $_SESSION['adults'] does have some int value (from 1 to 10) after it's been "set".
I've got a work-around that does work where I dump the session var into a local and then use the local ($adultsSaved) as the condition trigger, but I can't understand why the same thing won't work by just using $_SESSION['adults'] as the trigger.
Can anyone see where I'm going wrong here?
Neophyte
I was trying to look at posted vars and session vars
they were working but when I would redirect again at the bottom it would nuke everything
took me a while to figure out since I was looking at the right page but with no data, now THAT was dumb :)