Advertisement
Guest User

Untitled

a guest
May 29th, 2017
499
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 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. ");
  16.  
  17. echo ' registered';
  18. }else {
  19. echo'You must enter a username and password if you still have problems contact me - kevin@joycekevin.com!';
  20. }
  21. } else {
  22. echo '
  23. <p><form action = "register.php" method="post">
  24. Username: <input type="text" name ="username" /><br />
  25. Password: <input type="password" name="password" /><br />
  26. Email: <input type="text" name="email" /><br />
  27. <input type="submit" name="submit" value="Register" /></form>';
  28. }
  29.  
  30. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement