Advertisement
Guest User

Untitled

a guest
Aug 14th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. <html>
  2. <body>
  3.  
  4.  
  5. <?PHP
  6. $server = '72.14.188.135';
  7. $username = 'catz';
  8. $password = '12345';
  9. $database = 'All_Your_Base_Are_Belong_to_ME';
  10.  
  11. $db = mysql_connect($server, $username, $password, true);
  12. if(!$db){
  13. die('The grim reaper is going to come eat you'.mysql_error());
  14. }
  15. mysql_select_db($database);
  16.  
  17.  
  18. if(isset($_POST['submit'])){
  19. $_POST['comment'] = $comment;
  20. $_POST['name'] = $name;
  21. $sqlcomment = "UPDATE Guestbook SET comment = $comment WHERE id = '1'";
  22. $sqlname = "UPDATE Guestbook SET name = $name WHERE id = '1'";
  23. if(mysql_query($sqlcomment && $sqlname)){
  24. echo 'Commented! <br />';
  25. }
  26. }
  27.  
  28. $sqlComDisp = "SELECT comment FROM Guestbook WHERE id >= '1'";
  29. $sqlNameDisp = "SELECT comment FROM Guestbook WHERE id >= '1'";
  30. $comQuery = mysql_query($sqlComDisp);
  31. $nameQuery = mysql_query($sqlNameDisp);
  32. $commentDisp = mysql_fetch_assoc($comQuery);
  33. $nameDisp = mysql_fetch_assoc($nameQuery);
  34.  
  35. echo nl2br($commentDisp['comment']);
  36.  
  37. //mysql_fetch_assoc();
  38. //mysql_real_escape_string();
  39.  
  40.  
  41.  
  42. ?>
  43.  
  44. <form method="post" target="_self">
  45. <input type="text" size="140" name="comment" />
  46. <br />
  47. Name:<input type="text" name="name" />
  48. <br />
  49. <input type="submit" name="submit" value="Comment" />
  50. </form>
  51.  
  52. </body>
  53. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement