Commit cf45f958 by Visgha Olivia

Upload New File

parent 31ff61ea
<?php
require_once 'common/database.php';
$username = $_POST['username'];
$password = $_POST['password'];
$user = LoginAccount($username,$password);
$row = mysqli_fetch_assoc($user);
if($row['username'] == $username && $row['password'] == $password){
$_SESSION['logged_in'] = TRUE;
$_SESSION['id_akun'] = $row['id_akun'];
$_SESSION['username'] = $row['username'];
$_SESSION['role'] = $row['role'];
if($row['role'] == 1){
echo "<script>alert('Selamat datang $username');
window.location = 'dashboard.php'</script>";
}
elseif($row['role'] == 2){
echo "<script>alert('Selamat datang $username');
window.location = 'dashboard1.php'</script>";
}
}
else{
echo "<script>alert('Username dan Password tidak valid.');
window.location = 'index.php'</script>";
}
?>
\ No newline at end of file
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