What's wrong with this PHP code?

?pathtotake?

New member
I have two files:
a.php and
b.php

In file a.php I have the following code:
<html>
<head>
<title>My Page</title>
</head>
<body>

<p>Grade:<br /><input type="text" name="name" value="" /></p>
Level:


<form name="myform" action="b.php" method="POST">
<select name="mydropdown">
<option value="a">Under</option>
<option value="b">HND</option>
<option value="c">Masters</option>
</select>
<input type="submit" name="Submit" value="Submit">


</form>
</body>
</html>


and so in file b I have the following php code:
<?php

switch ($_GET['mydropdown'])
{
case a:
echo 'You chose A';
break;
case 'b':
echo 'You chose B';
break;
case 'c':
echo 'You chose C';
break;
}


?>


a.php posts to b.php, Ive been given this code by someone on here as well and I understand it, but it doesn't seem to work, when it posts it posts to a blank page instead of echoing "you chose whatever"

All I need here is for the switch statement to work and I can do the rest.
Thanks oddball
:D
 


Write your reply...
Back
Top