HTML:
<form method="post" action="proc.php">
<select name="yDept" class=sOptions>
<option disabled value="#" SELECTED>========</option>
<option value="acct">acct</option>
<option value="its">its</option>
</select>
</form>
PHP:
$ydept = trim(strip_tags(stripslashes($_POST['yDept'])));
$pass = 87;
if($fname <> "" && $lname <> "" && $theemail <> "" && $ydept <> "#") {
if ($pass >= 80) {
echo "passed"; //take to congrats.php page
}
else {
echo "no pass"; //take to nopass.php page
}
}
else {
echo "something is missing"; //take to the missing.php page
}
What I am looking to accomplish is, if the user does not change the value of select and choose something other than the disabled value, it should take the user to missing.php page. That works if the other values are blank but when it comes to $ydept, it always kicks in nopass.php page.
Am I checking the value of the select correctly in PHP? I think that's where the issue is?
I tried the following to see if it makes a difference:
$ydept = $_POST['yDept'];
But it didn't.