Commit 8c354753 by Roy Junedi Simamora

progress

parents 3d062ca0 16cb3164
......@@ -3,39 +3,7 @@
require_once(dirname(__FILE__).'/common/header.php');
require_once(dirname(__FILE__).'/cek_login.php');
require_once(dirname(__FILE__).'/fungsi/session.php');
global $con;
$con = mysqli_connect("localhost", "p1d3ti04", "p1d3ti04", "MeiHong05");
if (!$con) {
die("database connect problem");
}
$db_use = mysqli_select_db($con, "p1d3ti04_pondokedo") or die("selet db problem !!");
if(isset($_GET['do_login'])){
$login =getUser($_POST['username'],$_POST['password']);
if($login == false){
$_SESSION['login_error'] = TRUE;
}else{
$_SESSION['user'] = TRUE;
$row = mysqli_fetch_array($login);
$_SESSION['username'] = $row['username'];
$_SESSION['id_member'] = $row['id_member'];
$_SESSION['user'] = TRUE;
header("location:index.php");
}
$log =getAdmin($_POST['username'],$_POST['password']);
if($log == false){
$_SESSION['login_error'] = TRUE;
}else{
$resAdm = mysqli_fetch_array($log);
$_SESSION['admin'] = TRUE;
header("location:admin_menu.php");
}
if(isset($_SESSION["login_error"])){
echo "<script> window.alert('Login Gagal !! Username dan Password Salah !!')</script>";
}
}
?>
?>
<br/>
<form class='well form-horizontal' action='form_login.php?do_login=1' method='post' id='contact_form'>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment