Advertisement
Guest User

Untitled

a guest
Apr 10th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. <?php
  2.  
  3. $servername = "localhost";
  4. $name = "root";
  5. $pass = "";
  6. $database = "register";
  7.  
  8. $con = mysqli_connect($servername,$name,$pass,$database);
  9.  
  10.  
  11. $username = mysqli_real_escape_string($con, $_POST['username']);
  12. $email = mysqli_real_escape_string($con, $_POST['email']);
  13. $password = mysqli_real_escape_string($con, $_POST['password']);
  14.  
  15. $sql = "INSERT INTO users(username,email,password) VALUES('$username', '$email', '$password')";
  16.  
  17.  
  18. ?>
  19.  
  20. <html>
  21. <body>
  22. <div class="form">
  23. <h1>Registration</h1>
  24. <form name="registration" action="insert.php" method="post">
  25. <input type="text" name="username" id="username" placeholder="Username" required />
  26. <input type="email" name="email" id="email" placeholder="Email" required />
  27. <input type="password" name="password" id="password" placeholder="Password" required />
  28. <input type="submit" name="submit" value="Register" />
  29. </form>
  30. </body>
  31. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement