PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
function is_login() {
if ($_SESSION) {
if ($exp != true && $login == '') {
header("Location: HTTP://" .$_SERVER['HTTP_HOST'] ."/main/admin/index.php?loc=login");
}
}
else { header("Location: HTTP://" .$_SERVER['HTTP_HOST'] ."/main/admin/index.php?loc=login"); }
}
function checkuser($user ,$pass) {
$this->condb();
if ($this->condb()!=true) {
foreach ($this->auth as $data) {
if ($user == $data['user'] && $pass == $data['pass']) {
$login = $user;
$exp = true;
session_register('login');
session_register('exp');
header("Location: HTTP://" .$_SERVER['HTTP_HOST'] ."/main/admin/index.php?loc=main");
}
else {
$this->msg = "PassWord/User are not correct"; }
}
}
}
?>
when i active the function is_login the page is not work all the function just hold and don't send the user to any place even if he login and all the data are correct
how i can fix this
is_login() has no variables between the parathesis so it won't do anything even though all the code is there. It doesn't have any variables to work the code. Pass the variables required into it just like you did with checkuser().