Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- $username = $_POST['username'];
- $password = $_POST['password'];
- $_SESSION['username'] = $username;
- $_SESSION['password'] = $password;
- if ($username=="belajar" AND $password=="php"){
- header('location: user');
- }else{
- if (ini_get("session.use_cookies")) {
- $params = session_get_cookie_params();
- setcookie(session_name(), '', time() - 42000,
- $params["path"], $params["domain"],
- $params["secure"], $params["httponly"]
- );
- }
- session_destroy();
- echo "<script>alert('Username atau password salah!'); document.location.href=\"index.php\"</script>";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement