diff --git a/Library.id/actions/loginadmin.php b/Library.id/actions/loginadmin.php new file mode 100644 index 0000000..0ca5009 --- /dev/null +++ b/Library.id/actions/loginadmin.php @@ -0,0 +1,26 @@ +username = $_POST["username"]; +$login->password = $_POST["password"]; +$r = $login->login(); + +var_dump($r); + +if ($r != null) +{ + $_SESSION["id"] = $r["id"]; + $_SESSION["role"] = "admin"; + header("Location: ../homepage"); + exit; +} +else +{ + header("Location: ../loginadmin?err=1"); +} + +?> \ No newline at end of file diff --git a/Library.id/loginadmin.php b/Library.id/loginadmin.php new file mode 100644 index 0000000..1b7d9a9 --- /dev/null +++ b/Library.id/loginadmin.php @@ -0,0 +1,84 @@ + + Username atau password salah! + '; +} + +?> + + + +
+ + + + + + + +