Advertisement
Guest User

Untitled

a guest
May 29th, 2017
510
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. <?php
  2.  
  3. include('mysql.php');
  4.  
  5.  
  6. if (isset ($_POST['submit'])) {
  7. $username = mysql_escape_string($_POST['username']);
  8. $password = mysql_escape_string(sha1($_POST['password']));
  9. $email = mysql_escape_string($_POST['email']));
  10.  
  11.  
  12. if(!empty ($username) && !empty ($password) && !empty ($email)) {
  13. $sql = mysql_query("INSERT INTO users (user_id,username, user_password, user_email, user_regdate) VALUES
  14. ('0' ,'$username', '$password', '$email', '" . time() . "')");
  15. if($sql){ echo 'registered'; }
  16. else { echo 'unable to register'; }
  17. }else {
  18. echo'You must enter a username and password if you still have problems contact me - kevin@joycekevin.com!';
  19. }
  20. } else {
  21. echo '
  22. <p><form action = "register.php" method="post">
  23. Username: <input type="text" name ="username" /><br />
  24. Password: <input type="password" name="password" /><br />
  25. Email: <input type="text" name="email" /><br />
  26. <input type="submit" name="submit" value="Register" /></form>';
  27. }
  28.  
  29. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement