Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. <html>
  2.  
  3. <?php
  4. if(isset($_POST['submitted']))
  5. {$errors= array();
  6. require_once ('db.php');
  7. }
  8.  
  9. $username= $_POST['username'];
  10.  
  11. $password= $_POST['password'];
  12.  
  13. $query= "INSERT INTO users (username, password) VALUES ('$username', '$password')";
  14.  
  15. $result= @mysql_query($query);
  16.  
  17. if (mysql_affected_rows() ==1)
  18. {
  19. echo '<font color="green"> Thank You! </font>
  20. <font color="green">You have now been registered. Your account is now active and you are ready to log in.</font>';
  21. }
  22. else
  23. {
  24. echo '<font color="red"> You could not be registered, please contact us about the problem and we will fix it as soon as we can.</font>';
  25. }
  26. ?>
  27.  
  28. <head>
  29. <title>Registration</title>
  30. </head>
  31.  
  32. <body>
  33. <form id='register' action='register.php'
  34. method='post'
  35. accept-charset='UTF-8'>
  36. <legend>
  37. <input type='hidden' name-'submitted'
  38. id='submitted' value='1'/>
  39.  
  40. <label for='username'><br>
  41. Username:</label>
  42. <input type='text' name='username'
  43. id='username' maxlength="10" />
  44.  
  45. <br>
  46. <label for='password'> Password:</label>
  47. <input type='password' name='password'
  48. id='password' maxlength="30" />
  49.  
  50. <br>
  51.  
  52. <input type='submit' name='submit'
  53. value='submit' />
  54. </legent>
  55. </form>
  56. </body>
  57. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement