Switch not working
Posted: Fri May 23, 2003 10:15 pm
New to php!
Bought the PHP and MySQL web dev. book 2nd edition, seems like a good book but I can't get the following working.
Code in the html form:
Code in my PHP File:
WHenever I submit my form the result is always comes back wit the default "unknown"
I can't find whats wrong
Bought the PHP and MySQL web dev. book 2nd edition, seems like a good book but I can't get the following working.
Code in the html form:
Code: Select all
<tr>
<td>How did you find Bob's</td>
<td><select name="find">
<option value = "a">I'm a regular customer
<option value = "b">TV advertising
<option value = "c">Phone Directory
<option value = "d">Word of mouth
</select>
</td>
</tr>Code: Select all
switch ($find)
{
case 'a':
echo '<p>Regular Customer.</p>';
break;
case 'b':
echo '<p>TV Add.</p>';
break;
case 'c':
echo '<p>Phone Directory.</p>';
break;
case 'd':
echo '<p>Word of Mouth.</p>';
break;
default :
echo '<p>Unknown.</p>';
break;
}I can't find whats wrong