Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(!empty($_POST['username']) && !empty($_POST['password']))
- {
- $password = sha1($_POST['password'], true);
- $username = htmlspecialchars($_POST['username']);
- $db = mysql_connect("localhost", "problem1", "css7UjBmevbm");
- mysql_select_db("problem1",$db);
- $rs = mysql_query("SELECT * FROM authtable WHERE password = \"$password\" AND username = \"{$_POST['username']}\"");
- if(mysql_num_rows($rs) <= 0)
- echo 'Wrong username/password.<br />';
- else
- echo "Welcome {$_POST['username']}.<br />";
- }
- ?>
- <form method="post" name="form1">
- Username: <input type="textbox" name="username" maxlength="10" /><br />
- Password: <input type="textbox" name="password" maxlength="10" /><br />
- <input type="submit" name="submit" />
- </form>
- <p>
- Notices:<br />
- This system is now using the advanced SHA1 encryption function. Call the helpdesk if you need to change your password.
- </p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement