Advertisement
Guest User

Untitled

a guest
Aug 10th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "examkc_admin";
  4. $password = "baltictraining1";
  5. $dbname = "examkc_guestBook";
  6.  
  7.  
  8. // Create connection
  9. $conn = mysqli_connect($servername, $username, $password, $dbname);
  10.  
  11. $name = htmlspecialchars($_REQUEST["name"]);
  12. $email = htmlspecialchars($_REQUEST["email"]);
  13. $comment = htmlspecialchars($_REQUEST["comment"]);
  14. $date = date('y-m-d');
  15.  
  16. mysqli_query($conn , "INSERT INTO Entry (Guest_Name, Guest_Email, Comment, Date_Comment_Left)
  17. VALUES ('$name','$email','$comment','$date')");
  18.  
  19.  
  20.  
  21. //echo "Hello $name, Thank you for commenting! Your comment was ---- $comment ---- and a copy has been send to $email.";
  22.  
  23.  
  24.  
  25.  
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement