Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html lang="en">
- <head>
- <title>Registration</title>
- <link rel="stylesheet" type="text/css" href="css/style.css">
- </head>
- <body>
- <?php
- if (empty( $_POST ) ) {
- ?>
- <h1>Registration</h1>
- <form name="registration" action="registration" method="POST">
- <label for 'username'>Username: </label>
- <input type="text" name="username"/>
- <br>
- <label for 'password'>Password: </label>
- <input type="password" name="password"/>
- <br>
- <label for 'first_name'>First name: </label>
- <input type="text" name="first_name"/>
- <br>
- <label for 'surname'>Surname: </label>
- <input type="text" name="surname"/>
- <br>
- <label for 'address'>Address: </label>
- <input type="text" name="address"/>
- <br>
- <label for 'email'>Email: </label>
- <input type="text" name="email"/>
- <br />
- <button type="submit">Submit</button>
- </form>
- <?php
- $user = 'root';
- $pass = '';
- $db = new PDO( 'mysql:host=localhost;dbname=users', $user, $pass );
- $form = $_POST;
- $username = $form[ 'username' ];
- $password = $form[ 'password' ];
- $first_name = $form[ 'first_name' ];
- $surname = $form[ 'surname' ];
- $address = $form[ 'address' ];
- $email = $form[ 'email' ];
- } else {
- print_r( $_POST );
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement