form feedback doesn't send error message

I am new at php and I am not understanding why my form feedback is blank when the form is left blank. yet the feedback works fine if the form is filled out. can someone please help? (yes the form feedback is in the same folder as the form) thanks

code for form:

Simple HTML Form Enter your information in the form below

Name:

Email address:

Gender: Male Female

Age: Under 30 Between 30 and 60 Over 60

Comments:

code for form feed back:

Form Feedback <?php #Script 2.4 - handle_form.php #3

//validate the name:
if (!empty($_REQUEST[‘name’])) {
$name = $_REQUEST[‘name’];
}

else {
$name = NULL;
echo ’

You forgot to enter your name!

';
}

//validate the email:
if (!empty($_REQUEST[‘email’])) {
$email = $_REQUEST[‘email’];
}

else {
$email = NULL;
echo ‘

You forgot to enter your email address!

’;
}

//validate the comments:
if (!empty($_REQUEST[‘comments’])) {
$comments = $_REQUEST[‘comments’];
}

else {
$comments = NULL;
echo ‘

You forgot to enter your comments!

’;
}

//validate the gender:
if (isset($_REQUEST[‘gender’])) {
$gender = $_REQUEST[‘gender’];

//check $gender against specific values:
if ($gender ==‘M’) {
echo ‘

Good day, Sir!

’;
}

elseif ($gender ==‘F’) {
echo ‘

Good day, Madam!

’;
}

else {//unacceptable value.
$gender = NULL;
echo ‘

Gender should be either “M” or “F”!

’;
}

}

else { //this else clause applies to if $_Request[‘gender’] is not set
$gender = NULL;
echo ‘

You forgot to select your gender!

’;
}

//print the message if all of the tests have been passed:
if ($name && $gender && $comments) {
echo "

Thank you, $name, for the following comments:

$comments

We will reply to you at $email.

\n"; }

else { //Missing for value.
echo ‘

Please go back and fill out the form again.

’;
}
?>
Sponsor our Newsletter | Privacy Policy | Terms of Service