sudeepr71 Posted May 1, 2008 Share Posted May 1, 2008 Hi, I'm using phpsecurepages for client login, but needed to modify it slightly. Currently user 'a' with password 'b' goes to page 'ab.php'. But also, user 'c' with password 'd' goes to page 'ab.php' not 'cd.php.' I'm trying to add an if statement that makes user 'b' go to 'cd.php' here is the following code given with phpsecurepages: elseif ($useData == true && $useDatabase != true) { $numLogin = count($cfgLogin); $userFound = false; // check all the data input for ($i = 1; $i <= $numLogin; $i++) { if ($cfgLogin[$i] != '' && $cfgLogin[$i] == $login) { // user found --> check password if ($cfgPassword[$i] == '' || $cfgPassword[$i] != $password) { // password is wrong $message = $strPwFalse; include($cfgProgDir . "logout.php"); include($cfgProgDir . "interface.php"); exit; } $userFound = true; $userNr = $i; } } if ($userFound == false) { // user is wrong $message = $strUserNotExist; include($cfgProgDir . "logout.php"); include($cfgProgDir . "interface.php"); exit; } $userLevel = $cfgUserLevel[$userNr]; $ID = $cfgUserID[$userNr]; here is what I added: if ($userFound == true) { $weburl = $cfgPage[$userNr]]; header("Location: $weburl"); exit; } } cfgLogin, cfgPassword, and cfgPage are all declared in a different file like so: $cfgLogin[1] = 'a'; // login word $cfgPassword[1] = 'b'; // password $cfgPage[1] = 'ab.php'; //page $cfgLogin[2] = 'c'; $cfgPassword[2] = 'd'; $cfgPage[2] = 'cd.php'; When running the login, the browser says, "the server is redirecting the request for this address in a way that will never complete." Any ideas? I think the problem is within the if statement I where I assign $weburl to $cfgPage[%cfgNr]. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.