Guest User

Untitled

a guest
Feb 26th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. <html>
  2. <body>
  3. <form action="gobacktopage.com">
  4. <input type="submit" value="Add Another" />
  5. </form>
  6. </body>
  7. </html>
  8.  
  9.  
  10. <?php
  11. $servername = "myserver.amazonaws.com";
  12. $username = "myusername";
  13. $password = "mypassword";
  14. $dbname = "desireddatabase";
  15.  
  16. $verse= $_POST['verse'];
  17. $book= $_POST['book'];
  18. $reference = $_POST['reference'];
  19. $cleanverse = addslashes($verse);
  20.  
  21.  
  22. // Create connection
  23. $conn = new mysqli($servername, $username, $password, $dbname);
  24. // Check connection
  25. if ($conn->connect_error) {
  26. die("Connection failed: " . $conn->connect_error);
  27. }
  28.  
  29. if ($stmt = $conn->prepare("INSERT INTO myverses (versetext, book, reference) VALUES (?, ?, ?)")) {
  30.  
  31. // Bind the variables to the parameter as strings.
  32. $stmt->bind_param("sss", $cleanverse, $book, $reference);
  33.  
  34. // Execute the statement.
  35. $stmt->execute();
  36.  
  37. // Close the prepared statement.
  38. $stmt->close();
  39.  
  40. }
  41.  
  42.  
  43. $conn->close();
  44. ?>
Add Comment
Please, Sign In to add comment