I am new at this and need it for my senior project. I cant figure out what i am doing wrong or where to go. I have gone to other tutorials and sites and nothing is working.
Login.php
[php]<?PHP
error_reporting(9);
require_once("./include/membersite_config.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”);
}
}
?>[/php]
Login-home.php
[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";
}
?>[/php]
Please help me!!!