Posted by skim1114 on 09/01/07 23:33
I did have $age...for some reason I accidentally deleted it when I
posted here.
I am working or using the book "PHP and MySQL for dynamic websites"
By Larry Ullman.
It is validating the age selection in a form:
<select name="age">
<option value="0-29">Under 30</option>
<option value="30-60">Between 30 and 60</option>
<option value="60+">Over 60</option>
</select>
------
if (isset($_REQUEST['age'])) {
$age = $_REQUEST['age'];
if ($age == '0-29') {
echo '<p>Your age selection was between 0-29</p>';
}elseif ($age == '30-60') {
echo '<p>You age selection was between 30-60</p>';
}elseif ($age == '60+') {
echo '<p>You age selection was between 60+</p>';
}else{
$age = NULL;
echo '<p><font color="red">You forgot to select you age!</font></p>';
}
Navigation:
[Reply to this message]
|