Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php session_start();
- $username='cwarn23';
- $password='password';
- if (isset($_POST) && !empty($_POST)) {
- if ($_POST['user']==$username && $_POST['pass']==$password) {
- $_SESSION['user']=$username;
- }
- }
- if (isset($_SESSION['user'])) {
- echo 'You are logged in.';
- } else {
- echo 'Please log in<br><form method="POST">Username: <input type="text" name="user"><br>Password: <input type="text" name="pass"></form>';
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement