if($totalrowsModel == 0 && $formType == 2)
{
// Procedure 1
}
else if($_SESSION[‘loggedin’] == $userAccountEncrypt && $product!=”” && $spec !=”” && $PSID == $randomURL)
{
// Procedure 2
}
else if($_SESSION[‘loggedin’] == $userAccountEncrypt)
{
// Procedure 3
}
else
{
// Procedure 4
}
This is a typical bad programming style that does not converge to a
location. It is called “spaghetti program”. I need to exclude some
access to database but it seems like I must put the condition at
multiple locations.
if($totalrowsModel == 0 && $formType == 2)
{
}
else if($_SESSION[‘loggedin’] == $userAccountEncrypt)
{
if($product!=”” && $spec !=”” && $PSID == $randomURL)
{
// Procedure 2
}
else
{
// Procedure 3
}
}
else
{
// Procedure 4
}
At least, the conditionals must be formatted this way.