okay i have used arrays before but now im getting in to using more and more arrays.
the problem is that my page is blank and im positive it is the array for any actions for login, logout and stuff like that, but im somewhat unsure how to word the if statement so it detects if there is a value for $do and if that is false then to cancel that array and to continue. well here is my code
PHP Code:
$function = $_GET['function']; $page = $_GET['p']; $do = $_GET['do']; $do_arrary = array( 'login' => '/scripts/login.php', 'signup' => 'scripts/signup.php', 'logout' => 'scripts/logout.php', 'recover_pass' => 'scripts/recoverpass.php', 'change_pass' => 'scripts/changeuserpass.php', ); $actions = array( 'empty' => '', 'blank' => 'pages/home.php', 'pak' => 'pages/pak.php', 'about' => 'pages/about.php', 'contact' => 'pages/contact.php', 'news' => 'pages/news.php', 'contact' => 'pages/contact.php', 'offline' => 'pages/offline.php',
); if ($function == "offline") { echo "<center><h1>Sorry Function Not Avalible Yet</h1></center>"; $page = 'offline'; } if(!$do || !array_key_exists($do, $do_array)){ $do_action = 'NO'; } else{ include($do_array[ $do ]); $do_action = 'yes'; } if($do_action == NO){ if(!isset($page) || !array_key_exists($page, $actions)) { // $HTTP_GET_VARS['page'] = 'blank'; // set a default $page = 'blank'; include($actions[ $page ]); } else{ include($actions[ $page ]); } }
__________________
AMW_Drizz
Dev Machine:: Apache 2.2.6 PHP 5.2.6 MySQL 5.1
Last edited by amw_drizz; 12-08-2005 at 08:55 PM..
|