Advertisement
Guest User

o vai

a guest
Aug 3rd, 2017
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "webdmena_wp225";
  4. $password = "6lS]p92J!4";
  5. $dbname = "webdmena_wp225";
  6.  
  7.  
  8. @$text = $_POST['message'];
  9.  
  10. // Create connection
  11. $conn = new mysqli($servername, $username, $password, $dbname);
  12. // Check connection
  13. if ($conn->connect_error) {
  14. die("Database is Sleeping <br/>");
  15. }
  16.  
  17.  
  18.  
  19. if($text != null)
  20. {
  21. $sql = "INSERT INTO oremare (messages) VALUES (\"$text\")";
  22.  
  23. if ($conn->query($sql) === TRUE)
  24. {
  25. echo "<h4 class=\"center\">Message Delivered Successfully! <a href=\"index.html\">Send Another</a></h4>";
  26. }
  27. } else {
  28. echo "<h4 class=\"center\">You must enter a valid data! <a href=\"index.html\">Retry</a></h4>";
  29.  
  30. }
  31.  
  32. $conn->close();
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement