Advertisement
Guest User

Untitled

a guest
Sep 9th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. if(!empty($_POST['username']) && !empty($_POST['password']))
  5. {
  6. $password = sha1($_POST['password'], true);
  7. $username = htmlspecialchars($_POST['username']);
  8.  
  9. $db = mysql_connect("localhost", "problem1", "css7UjBmevbm");
  10. mysql_select_db("problem1",$db);
  11. $rs = mysql_query("SELECT * FROM authtable WHERE password = \"$password\" AND username = \"{$_POST['username']}\"");
  12.  
  13. if(mysql_num_rows($rs) <= 0)
  14. echo 'Wrong username/password.<br />';
  15. else
  16. echo "Welcome {$_POST['username']}.<br />";
  17. }
  18. ?>
  19.  
  20. <form method="post" name="form1">
  21. Username: <input type="textbox" name="username" maxlength="10" /><br />
  22. Password: <input type="textbox" name="password" maxlength="10" /><br />
  23. <input type="submit" name="submit" />
  24. </form>
  25. <p>
  26. Notices:<br />
  27. This system is now using the advanced SHA1 encryption function. Call the helpdesk if you need to change your password.
  28. </p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement