this bit of scripting crashes the page when i add it into the existing php scripted page that is handling the form data from another page.
// checks for a set radio button and assigns the value to a variable (or NULL)
if (isset($_REQUEST['gender'])) {
$gender = $_REQUEST['gender'];
} else {
$gender = NULL;
}
//print a message based on the gender value
if ($gender == 'm') {
echo '<p>good day,
sir</p>';
}elseif ($gender == 'f') {
echo '<p>good day,
miss</p>';
} else }
echo '<p>please select
a gender</p>';
}
I've looked at this for an hour now, fixed a typo here and there. i tried double quotes on the echo statement, but still cannot get it to play nice.
this new snippet is inside the <?php ?> tags,
the variable assignment is in line with the other variable assigns;
the echo request follows another echo request that functioned fine before this was added.
any ideas?
thanks
yamy
// checks for a set radio button and assigns the value to a variable (or NULL)
if (isset($_REQUEST['gender'])) {
$gender = $_REQUEST['gender'];
} else {
$gender = NULL;
}
//print a message based on the gender value
if ($gender == 'm') {
echo '<p>good day,
sir</p>';
}elseif ($gender == 'f') {
echo '<p>good day,
miss</p>';
} else }
echo '<p>please select
a gender</p>';
}
I've looked at this for an hour now, fixed a typo here and there. i tried double quotes on the echo statement, but still cannot get it to play nice.
this new snippet is inside the <?php ?> tags,
the variable assignment is in line with the other variable assigns;
the echo request follows another echo request that functioned fine before this was added.
any ideas?
thanks
yamy