Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $servername = "localhost";
- $username = "";
- $password = "";
- $dbname = "website";
- if (isset($_POST['submit'])) {
- //create Connection
- $conn = new mysqli($servername , $username , $password, $dbname);
- // Check if connection has been failed
- if ($conn->connect_error) {
- die("Connection failed: " . $conn->connect_error);
- } else echo "Connected successfully";
- // Retrieving inputboxes
- $username = $_POST ['username'];
- $password = $_POST ['password'];
- $sql = "INSERT INTO 'users' ('username' , 'password') VALUES ($username , $password)";
- }
- ?>
- <!DOCTYPE html>
- <html lang="nl">
- <head>
- <meta charset="utf-8">
- <meta name="description" content="RCOLA media ontwikkeling">
- <meta name="author" content="ROCLA media development team">
- <title>Login</title>
- </head>
- <body>
- <form method="post">
- <!-- Username -->
- <label for="username">Username:</label>
- <input type="textbox" name="username" id="username" value="">
- <!-- END Username -->
- <!-- Password -->
- <label for="password">Password:</label>
- <input type="textbox" name="password" id="password" value="">
- <!-- END Password -->
- <!-- Submit -->
- <input type="submit" name="submit"></input>
- <!-- END Submit -->
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement