Hello,
Anyone know how to get a session var. from a while loop.
Here is some code:
<form id="form1" name="form1" method="post" action="">
<p>Age:
<select name="age" id="age">
<option value="0">Select Age</option>
<?php
$i=1;
while($i<=100)
{
echo '<option value="1">'.$i.'</option>';
$i++;
}
?>
It's from a drop down menu.
Here is the code for the session var I want to create:
if ($_POST && !empty($_POST['age'])) {
echo $_SESSION['age'] = $_POST['age'];
}
Any help would be great!