Hello all:
I am a working on a website someone else designed and trying to work my way backwords through the code. One area has a form that, when filled out, gets emailed. If required areas are not checked, a message is returned telling you what's missing.
Here's my problem: I keep a getting a message telling me that the "Priority" field is missing an input, even though I keep selecting an item in the "Priority" menu box. I suspect that there is something missing in the script below. Can someone take a look and see if they find something??
Sorry it's a mess. Thank you, Matt Brown
$serviceType = $GET['serviceType'];
$serviceType_1 = $POST['serviceType'];
//echo $serviceType;
//echo $serviceType_1;
//echo $_REQUEST['req'];
switch($_REQUEST['req']){
case "process":
myheader("Request a Quote");
/*uncomment this to debug*/
/* echo "First name: $_POST[firstName]\n".
"Last name: $_POST[lastName]\n".
"companyName: $_POST[companyName]\n".
"streetAddress: $_POST[street]\n".
"city: $_POST[city]\n".
"state: $_POST[state]\n".
"Other State Info: $_POST[state_other]\n".
"zip: $_POST[zip]\n".
"country: $_POST[country]\n".
"phoneNumber: $_POST[phoneNumber]\n".
"cell: $_POST[cell]\n".
"mediaType: $_POST[mediaType]\n".
"operatingSys: $_POST[operatingSys]\n".
"sysType: $_POST[sysType]\n".
"capacity: $_POST[capacity]\n".
"referral: $_POST[referral]\n".
"newsletter: $_POST[newsletter]\n"; */
if(!$_POST['firstName'] ||
!$_POST['lastName'] ||
!$_POST['street'] ||
!$_POST['city'] ||
!$_POST['state'] ||
!$_POST['zip'] ||
!$_POST['country'] ||
!$_POST['phoneNumber'] ||
!$_POST['servicerequest'] ||
!$_POST['priority']
){
$errors .= "<strong>Form Input Errors:".
"</strong>\n\n";
$error = true;
if(!$_POST['firstName']){
$errors .= "Missing First Name\n";
}
if(!$_POST['lastName']){
$errors .= "Missing Last Name\n";
}
if(!$_POST['street']){
$errors .= "Missing Street \n";
$email_error = true;
}
if(!$_POST['city']){
$errors .= "Missing City\n";
}
if(!$_POST['state']){
$errors .= "Missing State\n";
}
if(!$_POST['zip']){
$errors .= "Missing Zip\n";
}
if(!$_POST['country']){
$errors .= "Missing Country\n";
}
if(!$_POST['phoneNumber']){
$errors .= "Missing Phone Number\n";
}
if(!$_POST['servicerequest']){
$errors .= "Missing Service Request \n";
}
if(!$_POST['priority']){
$errors .= "Missing Priority \n";
}
}// end of if
// If $error is TRUE, then include the singup form
// and display the errors we found.
if($error == true){
$errors = nl2br($errors);
?>