SHARE
TWEET

Untitled

a guest Jun 4th, 2017 65 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. echo"<h1>Register</h1>";
  3.  
  4. $submit = $_POST['reg'];
  5. $username = $_POST['username'];
  6. $password = $_POST['password'];
  7. $confpass = $_POST['confpassword'];
  8. $email = $_POST['email'];
  9.  
  10. if(!empty($_POST))
  11. {
  12. // the form has been filled
  13. if ($password==$confpass)
  14. {
  15. // The dirty Connect stuff
  16. $connect = mysql_connect ("localhost","root","");
  17. mysql_select_db ("betasite");
  18. $queryregister = mysql_query ("INSERT INTO TABLE users VALUES ('','$username','$password','$email','0')");
  19. die("You are Registered");
  20. }
  21. else
  22. {
  23. echo "Passwords Don't match";
  24. }
  25. }
  26. else
  27. {
  28. echo"Enter something into <b>all</b> boxes";
  29. }
  30. ?>
  31.  
  32. <html>
  33.  
  34. <form action='register.php' method='POST'>
  35.     <table>
  36.     <tr>
  37.     <td>
  38.     Pick a Username
  39.     </td>
  40.     <td>
  41.     <input type='text' name='username' value='<?php echo $username ?>'/><br>
  42.     </td>
  43.     </tr>
  44.    
  45.     <tr>
  46.     <td>
  47.     Pick a Password
  48.     </td>
  49.     <td>
  50.     <input type='password' name='password'/><br>
  51.     </td>
  52.     </tr>
  53.    
  54.     <tr>
  55.     <td>
  56.     Repeat the Password
  57.     </td>
  58.     <td>
  59.     <input type='password' name='confpassword'/><br>
  60.     </td>
  61.     </tr>
  62.    
  63.     <tr>
  64.     <td>
  65.     Your Email
  66.     </td>
  67.     <td>
  68.     <input type='text' name='email' value='<?php echo $email ?>'/><br>
  69.     </td>
  70.     </tr>
  71.     </table>
  72.     <input type="submit"  name="reg" value="Register"/>
  73. </form>
  74.  
  75. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top