Advertisement
Guest User

Untitled

a guest
Nov 16th, 2017
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  4. <body>
  5. <?php
  6. $servername = "mysql.cba.pl";
  7. $username = "mmalewski";
  8. $password = "Cojestkurwa123";
  9. $dbname = "mmalewski";
  10.  
  11. // Create connection
  12. $conn = new mysqli($servername, $username, $password, $dbname);
  13. // Check connection
  14. if ($conn->connect_error) {
  15. die("Connection failed: " . $conn->connect_error);
  16. }
  17.  
  18. $imie = $_POST["Imie"];
  19. $nazwisko = $_POST["nazwisko"];
  20. $wiek = $_POST["wiek"];
  21. $plec = $_POST["plec"];
  22. $hobby = $_POST["hobby"];
  23. $opis = $_POST["message"];
  24. $haslo = $_POST["haslo"];
  25. $zdjecie = $_POST["filetoUpload"];
  26.  
  27. $sql = "INSERT INTO `DB`(`ID`, `Imie`, `Nazwisko`, `Wiek`, `Plec`, `Zainteresowania`, `Opis`, `Haslo`, `Zdjecie`) VALUES ('3','$imie','$nazwisko','$wiek','$plec','$hobby','$opis','$haslo','$zdjecie')";
  28.  
  29. if ($conn->query($sql) === TRUE) {
  30. echo "New record created successfully";
  31. } else {
  32. echo "Error: " . $sql . "<br>" . $conn->error;
  33. }
  34.  
  35. $conn->close();
  36. ?>
  37. </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement