Guest User

Untitled

a guest
Jan 15th, 2018
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <!-- BEGIN PHP -->
  2. <?php%20echo%20$_SERVER[%27PHP_SELF%27];?> I get that in the url idk if it helps the rest is the inser.php code.
  3.  
  4. <?php
  5. $servername = "localhost";
  6. $username = "Placeholder";
  7. $pass = "FakeForShow";
  8. $dbname = "sign up new";
  9.  
  10.  
  11. $fullname=$_POST['fullname'];
  12. $username=$_POST['username'];
  13. $email=$_POST['email'];
  14. $password=$_POST['password'];
  15. $codelangs=$_POST['codelangs'];
  16.  
  17. // Create connection
  18. $conn = new mysqli($servername, $username, $pass, $dbname);
  19. // Check connection
  20. if ($conn->connect_error) {
  21.  
  22. die("Connection failed: " . $conn->connect_error);
  23. }
  24.  
  25. $sql = "INSERT INTO newusers (fullname, username, password, email, codelang)
  26. VALUES ( '$fullname', '$username', '$email', '$password', '$codelangs');";
  27.  
  28. if ($conn->query($sql) === TRUE) {
  29. header("location: index.html");
  30. } else {
  31. echo "Error: " . $sql . "<br>" . $conn->error;
  32. }
  33.  
  34. ?>
  35.  
  36. <!-- END OF PHP -->
Add Comment
Please, Sign In to add comment