I have some code that i dont think is working. I have a login page, that directs to two different pages depending on who it is.
Login.php
if(isset($_POST['submitted']))
{
$users['admin'] = array('password' => 'admin', 'redirect' => 'admin.php');
$users[$username] = array('password' => $password, 'redirect' => 'login-home.php');
if(array_key_exists($POST['username'],$users)) {
if($POST['password'] == $users[$POST['username']]['password']) {
$SESSION['loggedIn'] = true;
header('Location:'.$users[$_POST['username']]['redirect']);
exit();
}
}
if($fgmembersite->Login())
{
$fgmembersite->RedirectToURL("login-home.php");
}
}
?>
if it is a plain user they direct to login-home.php
<?PHP
session_start();
error_reporting(E_ALL|E_STRICT);
require_once("./include/membersite_config.php");
if(!$fgmembersite->CheckLogin())
{
$fgmembersite->RedirectToURL("login.php");
}
//Validate there is a user
if($result) {
if($num_rows == 1) {
session_start();
$_SESSION['login'] = '1';
header("location: ../login_success.php");
} else {
session_start();
$_SESSION['login'] = "";
header("location: ../login_fail.php");
}
} else {
$error_msg = "Error Validating User! -1";
}
?>
Basically, when a user logs in I need their information to show up so they can edit it. I can connect to database, but it doesnt seem like im actually logged in. And no matter what i do i cant pull the information from the login to pull information about who logged on. Please help!!!