Created
February 17, 2017 02:39
-
-
Save inuvalogic/c98dcf91c0c17a516a48ce61ad6d693a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
if (isset($_SESSION['login'])){ | |
session_destroy(); | |
header("Location: login.php"); | |
} | |
if (isset($_POST['submit'])){ | |
$_SESSION['login'] = true; | |
header("Location: masuk.php"); | |
exit; | |
} | |
?> | |
<form method="post"> | |
<button type="submit" name="submit">Login</button> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); | |
if (isset($_SESSION['login'])){ | |
echo 'udah login'; | |
} else { | |
header("Location: login.php"); | |
exit; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment