MySQL Forums
Forum List  »  PHP

Why doesn't my variable have a value?
Posted by: Paul Knowles
Date: September 09, 2009 04:46AM

When I select a checkbox, no results are returned so I echoed the variable to the page and its empty which I cant seem to understand why?

Here is the PHP code


//display all roof height vehicles when submit button isnt pressed
if (!isset($_POST['Submit'])) {
$RoofHeight = "N/A', 'Standard Roof', 'Medium Roof', 'High Roof";
}


//N/A Roof Height Only
if (isset($_POST['Submit']) && isset($_POST['N/A'])) {
$RoofHeight = $RoofHeight."N/A";
}

//Standard Roof Only
if (isset($_POST['Submit']) && isset($_POST['Standard Roof'])) {
// add comma if necessary to separate

if (!empty($RoofHeight))
{
$RoofHeight = $RoofHeight."', '";
}
$RoofHeight = $RoofHeight."Standard Roof";
}

//Medium Roof Only
if (isset($_POST['Submit']) && isset($_POST['Medium Roof'])) {
// add comma if necessary to separate

if (!empty($RoofHeight))
{
$RoofHeight = $RoofHeight."', '";
}
$RoofHeight = $RoofHeight."Medium Roof";
}


//High Roof ONLY
if (isset($_POST['Submit']) && isset($_POST['High Roof'])) {
// add comma if necessary to separate

if (!empty($RoofHeight))
{
$RoofHeight = $RoofHeight."', '";
}
$RoofHeight = $RoofHeight."High Roof";
}


Thanks in advance

Options: ReplyQuote


Subject
Written By
Posted
Why doesn't my variable have a value?
September 09, 2009 04:46AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.