I am having a problem getting the correct feedback from a form on an HTML page that links to a PHP file. The form is a select form I copied below:
<form action="mash.php" method="post">
<br />
<br />
<center><strong>Pick a Method</strong></center>
<select name="way">
<option value="1">All of them
<option value="2">buying day after method
<option value="3">buying three days later method
<option value="4">short for three days method
</select>
<input type="submit" value="Result">
</form>
The resulting "mash.php" file is copied below:
<html>
<head>
</head>
<body>
<?php
$way = $_post['way'];
if ($way == 1) {
$choice = 'not';
}
elseif ($way == 2) {
$choice = 'Thank';
}
elseif ($way == 3) {
$choice = 'You';
}
else {
$choice = 'Fish and chips';
}
?>
<h2>Your Choice is:</h2>
<?php echo $choice; ?>
</body>
</html>
I want the number selection in the form to match the statement number in the "if/elseif" statement. However, the page always defaults to "Your Choice is: Fish and Chips", regardless of the selection. Any help?