Advertisement
Guest User

test

a guest
Sep 12th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.31 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "";
  4. $password = "";
  5. $dbname = "website";
  6.  
  7.  
  8.  
  9. if (isset($_POST['submit'])) {
  10.     //create Connection
  11.     $conn = new mysqli($servername , $username , $password, $dbname);
  12.  
  13.     // Check if connection has been failed
  14.     if ($conn->connect_error) {
  15.         die("Connection failed: " . $conn->connect_error);
  16.     } else echo "Connected successfully";
  17.    
  18.  
  19.     // Retrieving inputboxes
  20.     $username = $_POST ['username'];
  21.     $password = $_POST ['password'];
  22.  
  23.     $sql = "INSERT INTO 'users' ('username' , 'password') VALUES ($username , $password)";
  24. }
  25.  
  26. ?>
  27.  
  28. <!DOCTYPE html>
  29. <html lang="nl">
  30. <head>
  31.     <meta charset="utf-8">
  32.     <meta name="description" content="RCOLA media ontwikkeling">
  33.     <meta name="author" content="ROCLA media development team">
  34.     <title>Login</title>
  35. </head>
  36. <body>
  37. <form  method="post">
  38.     <!-- Username -->
  39.     <label for="username">Username:</label>
  40.     <input type="textbox" name="username" id="username" value="">
  41.     <!-- END Username -->
  42.  
  43.     <!-- Password -->
  44.     <label for="password">Password:</label>
  45.     <input type="textbox" name="password" id="password" value="">
  46.     <!-- END Password -->
  47.  
  48.     <!-- Submit -->
  49.     <input type="submit" name="submit"></input>
  50.     <!-- END Submit -->
  51. </form>
  52. </body>
  53. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement