Advertisement
Guest User

Untitled

a guest
Jul 12th, 2019
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. <?php
  2. require "connection.php";
  3.  
  4. if(!$con)
  5. {
  6. echo 'Not Connected To Server';
  7. }
  8.  
  9. if(mysqli_select_db($con,'wishes_database'))
  10. {
  11. header('location: thankyou.html');
  12. }
  13.  
  14.  
  15. $Name = $_POST['name'];
  16. $Character = $_POST['character'];
  17. $Wishes = $_POST['wish'];
  18.  
  19. $sql = "INSERT INTO comments (Name,Favorite,Comment) VALUES ('$Name','$Character','$Wishes')";
  20.  
  21. if(mysqli_query($con,$sql))
  22. {
  23. echo 'Not Inserted';
  24. }
  25. else
  26. {
  27. echo 'Not Inserted Dummy';
  28. }
  29.  
  30. {
  31. String userString="a'bcd";
  32. String changedUserString = userString.replace("'","''");
  33. //changedUserString = a''bcd
  34. String insertTableSQL = "INSERT INTO myTable (insertColumn) VALUES("
  35. +" '"+changedUserString +"' )";
  36. }
  37. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement