Advertisement
Guest User

Untitled

a guest
Jan 25th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $dbusername = "ryan";
  4. $dbpassword = "rocx";
  5. $dbname = "test_php";
  6.  
  7. $fname = $_POST ['username'];
  8. $fname = $_POST ['email'];
  9. $fname = $_POST ['password'];
  10. $fname = $_POST ['password_confirm'];
  11.  
  12. //Create Connection
  13. $conn = new mysqli ($servername, $dbusername, $dbpassword, $dbname);
  14.  
  15. //Check Connection
  16. if ($conn->connect_error) {
  17. die("connection_failed: " . $sconn->connect_error);
  18. }
  19.  
  20. $sql = "INSERT INTO accounts (username, email, password, password_confirm)
  21. VALUES ('username', 'email', 'password', 'password_confirm')";
  22.  
  23. if ($conn->query($sql) === TRUE) {
  24. echo "Thanks for registering at Kitnet, enjoy!";
  25. } else {
  26. echo "Error: " . $sql . "<br>" . $conn->error;
  27. }
  28.  
  29. $conn->close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement