var check not working...

From: Date: Mon, 15 Dec 2003 16:28:55 +0000
Subject: var check not working...
Groups: php.general 
Request: Send a blank email to php-general+get-172741@lists.php.net to get a copy of this message
For some reason this will not work... my $_POST variables check for no form variables and display a form... if they choose an item from a select box it queries the database for a field matching the $_post var and builds a new form creating 8 separate $_post variables to check for.. so far it works except when selecting an item from the select box it will only display the first form when there are $_post vars present. I think I am missing something, could someone look over my code? Thanks in advance, Jas function vlans_dhcp() { $lvl = base64_decode($_SESSION['lvl']); if ($lvl != "admin") { $_SESSION['lvl'] = base64_encode($lvl); $_SESSION['msg'] = $dberrors[12]; call_user_func("db_logs"); } elseif ($lvl == "admin") { $_SESSION['lvl'] = base64_encode($lvl); if (($_POST == "") || (!isset($_POST['dhcp_vlans'])) || (!isset($_POST['sub'])) || (!isset($_POST['msk'])) || (!isset($_POST['dns01'])) || (!isset($_POST['dns02'])) || (!isset($_POST['rtrs'])) || (!isset($_POST['vlans']))) { create 1st form with dhcp_vlans as $_post var....; } elseif (($_POST != "") || (isset($_POST['dhcp_vlans'])) || ($_POST['dhcp_vlans'] != "--------------") || (!isset($_POST['sub'])) || (!isset($_POST['msk'])) || (!isset($_POST['dns01'])) || (!isset($_POST['dns02'])) || (!isset($_POST['rtrs'])) || (!isset($_POST['vlans']))) { create 2nd form based on dhcp_vlans $_post var and create 8 different $_post vars...; } elseif (($_POST != "") || (!isset($_POST['dhcp_vlans'])) || (isset($_POST['id'])) || (isset($_POST['sub'])) || (isset($_POST['msk'])) || (isset($_POST['dns01'])) || (isset($_POST['dns02'])) || (isset($_POST['rtrs'])) || (isset($_POST['rnge'])) || (isset($_POST['vlans']))) { now put 8 $_post vars in database...; } else { $_SESSION['lvl'] = base64_encode($lvl); header("Location: help.php"); } } else { $_SESSION['lvl'] = base64_encode($lvl); $_SESSION['msg'] = $dberrors[12]; call_user_func("db_logs"); } }

« previous php.general (#172741) next »