Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Crappy login script.
- */
- $username = "administrator";
- $password = "testing";
- if( !empty( $_POST['login'] ) )
- {
- if( $_POST['user'] == $username )
- {
- if( $_POST['pass'] == $password )
- {
- //give session to user
- //redirect to admin page
- echo "you are now logged in";
- } else {
- //throw error
- echo "incorrect username";
- }
- } else {
- //throw error
- echo "incorrect username";
- }
- } else
- ?>
- <form action="" method="post" >
- Username: <input type="text" name="user" /><br />
- Password: <input type="text" name="pass" /><br />
- <input type="hidden" name="login" value="true" />
- <input type="submit" value="Log In!" />
- </form>
Add Comment
Please, Sign In to add comment