Advertisement
lowheartrate

registration.php

Mar 17th, 2015
259
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. <html lang="en">
  2. <head>
  3. <title>Registration</title>
  4. <link rel="stylesheet" type="text/css" href="css/style.css">
  5. </head>
  6.  
  7. <body>
  8.  
  9. <?php
  10. if (empty( $_POST ) ) {
  11. ?>
  12.  
  13. <h1>Registration</h1>
  14.  
  15. <form name="registration" action="registration" method="POST">
  16. <label for 'username'>Username: </label>
  17. <input type="text" name="username"/>
  18. <br>
  19. <label for 'password'>Password: </label>
  20. <input type="password" name="password"/>
  21. <br>
  22. <label for 'first_name'>First name: </label>
  23. <input type="text" name="first_name"/>
  24. <br>
  25. <label for 'surname'>Surname: </label>
  26. <input type="text" name="surname"/>
  27. <br>
  28. <label for 'address'>Address: </label>
  29. <input type="text" name="address"/>
  30. <br>
  31. <label for 'email'>Email: </label>
  32. <input type="text" name="email"/>
  33. <br />
  34. <button type="submit">Submit</button>
  35. </form>
  36.  
  37. <?php
  38.  
  39. $user = 'root';
  40. $pass = '';
  41. $db = new PDO( 'mysql:host=localhost;dbname=users', $user, $pass );
  42.  
  43. $form = $_POST;
  44. $username = $form[ 'username' ];
  45. $password = $form[ 'password' ];
  46. $first_name = $form[ 'first_name' ];
  47. $surname = $form[ 'surname' ];
  48. $address = $form[ 'address' ];
  49. $email = $form[ 'email' ];
  50.  
  51. } else {
  52. print_r( $_POST );
  53. }
  54. ?>
  55.  
  56. </body>
  57. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement