Soldato
Last problem I have is that when I load my formpage.php it errors with undefined variable in the for each of the cases in the switch.
I suspect it's something to do wtih the isset submit stuff at the top, because until someone presses submit, then the variable $education is not defined.. but I am unsure how to fix it... Can anyone help me?
I suspect it's something to do wtih the isset submit stuff at the top, because until someone presses submit, then the variable $education is not defined.. but I am unsure how to fix it... Can anyone help me?
PHP:
<?php
if (isset($_POST['submit'])) {
if (isset($_POST["Education"])){
$education = $_POST["Education"];
}
}
?>
<html>
<head>
<title>Personal INFO</title>
</head>
<body>
<form action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>" method="post">
Select your level of education:<br />
<select name="Education">
<option value="Default"></option>
<option value="PrimarySchool">Primary School</option>
<option value="MiddleSchool">Middle School</option>
<option value="HighSchool">High School</option></select><br />
<input type="submit" value="submit" name="submit">
</form>
<?php
switch ($education){
case "Default":
echo "Display stuff";
break;
case "PrimarySchool":
echo "Primary School";
break;
case "MiddleSchool":
echo "Middle School";
break;
case "HighSchool":
echo "High School";
break;
}
?>
</body>
</html>