Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- register.html
- <!DOCTYPE html>
- <html>
- <head>
- <title>register</title>
- <link rel="stylesheet" href="css/style.css" />
- </head>
- <body>
- <h2>Register</h2>
- <form action="../php/register.php" method="POST">
- <table>
- <tr>
- <td><b>Username</b></td>
- <td><input type="text" placeholder="Enter Username" name="name" required></td>
- </tr>
- <tr>
- <td><b>Email Address</b></td>
- <td><input type="email" placeholder="Enter Email Address" name="email" required></td>
- </tr>
- <tr>
- <td><b>Password</b></td>
- <td><input type="password" placeholder="Enter Password" name="pass" required></td>
- </tr>
- </table>
- <p>
- <input type="checkbox" checked="checked" name="remember"> Remember me
- <button type="submit">Login</button>
- </p>
- <p>
- <a href="passwordrecover.html">forgot password?</a>
- <p>
- </form>
- </body>
- </html>
- connect.php
- <?php
- $con = mysqli_connect('localhost', 'rick', 'dqATWGne65zc2V', 'Discussieforum');
- if (!$con) {
- echo "Error: " . mysqli_connect_error();
- exit();
- }
- register.php
- <?php
- // phpinfo();
- require('connect.php');
- $username = $_POST['name'];
- $email = $_POST['email'];
- $password = $_POST['pass'];
- $query = "INSERT INTO `users` (`name`, `pass`, `email`) VALUES ($username, $password, $email)";
- mysqli_query($con, $query);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement