Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $result = $mysqli->query("SELECT * FROM user");
- if ($result) {
- $get = $result->fetch_object();
- if (trim($username)==$get->username && trim($password)==$get->password) {
- if ($get->status == 0) {
- $mysqli->query("UPDATE user SET status = '1' WHERE username = '$username' AND password = '$password' ");
- $_SESSION['id'] = $get->id;
- $_SESSION['username'] = $get->username;
- $_SESSION['level'] = $get->level;
- $_SESSION['level2'] = $get->level2;
- header("location:index.php");
- } else {
- echo '<script>window.alert("anda telah login");window.location=("login.php");</script>';
- }
- } else {
- $_SESSION['pesan'] = "Your Username or Password was incorrect";
- header("location:login.php");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement