Advertisement
Guest User

Untitled

a guest
Jun 21st, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.73 KB | None | 0 0
  1. <html>
  2. <login>
  3. <form action="" method="POST">
  4. <input type="text/html" name="username"/>
  5. <input type="password" name="pass"/>
  6. <input type="submit"  value="submit" />
  7. </login>
  8. <?php
  9. error_reporting('E_NONE');
  10. $user=htmlentities($_POST['username']);//name to register
  11. $pass=htmlentities($_POST['pass']);//password to register
  12. $host="localhost";
  13. if(empty($user) || (empty($pass)))
  14. {
  15.     die("EMPTY FIELDS!");
  16. }
  17. else
  18. {
  19. mysql_connect($host,"root","LMAOPASSWORD") or die("failed to submit");//connect to mysqldb
  20. mysql_selectdb("Ulogin");
  21. $user=sha1(sha1($user));
  22. $pass=sha1(sha1($pass));
  23. mysql_query("insert "."into Users (username, userpwd)". " values (". $user." ".$pass.");");//send registration query
  24. mysql_close($host);
  25. }
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement