Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. <body>
  2. <div class="center">
  3. <?php
  4.  
  5. /* CONNECTION */
  6. $database_connection = new StdClass();
  7.  
  8. /** MySQL hostname */
  9. $database_connection->server = '829.23.12.123';
  10.  
  11. /** MySQL database username */
  12. $database_connection->username = 'something_usr';
  13.  
  14. /** MySQL database password */
  15. $database_connection->password = 'KJGAout7L';
  16.  
  17. /** The name of the database */
  18. $database_connection->name = 'database_content';
  19.  
  20. /* ESTABLISHING THE CONNECTION */
  21. $database = new mysqli($database_connection->server, $database_connection->username, $database_connection->password, $database_connection->name);
  22.  
  23. if($database->connect_error) {
  24.  
  25. echo 'connection failed';
  26. }
  27.  
  28. $stmt = $database->prepare("INSERT INTO Email_Subs (email) VALUES (?)");
  29. $stmt->bind_param("s", $_POST[email]);
  30. $stmt->execute();
  31. $stmt->close();
  32.  
  33. echo "<div class='jumbotron text-xs-center bg-white'>";
  34. echo "<h1 class='display-3'>Thank you, you have successfully subscribed!</h1>";
  35. echo "<p class='lead'>You will be the first to hear about news, events, exclusive stories, and more!</p>";
  36. echo "<p class='lead'>";
  37. echo "<a class='btn btn-primary btn-sm' href='index'>Return to Home</a>";
  38. echo "</p>";
  39. echo "</div>";
  40.  
  41. $database->close();
  42.  
  43. ?>
  44. </div>
  45.  
  46. </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement