Advertisement
Jesse_Suvisuo

Untitled

Feb 19th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.01 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3.   <head>
  4.     <meta charset="UTF-8">
  5.  
  6.     <title>Vieraskirja</title>
  7.   </head>
  8.   <body>
  9.   <h1>Studion Vieraskirja</h1>
  10.  
  11.  
  12.  
  13. <?php
  14.  
  15. include ("../yhteys.php");
  16. include ("../vieraskirja.php");
  17.  
  18. $nimi=$_POST["nimi"];
  19. $viesti=$_POST["viesti"];
  20. $hyvaksytty=$_POST["hyvaksytty"];
  21.  
  22. $comment=new Kommentti();
  23. $comment->setNimi($nimi);
  24. $comment->setViesti($viesti);
  25. $comment->setHyvaksytty($hyvaksytty);
  26.  
  27.  
  28.  
  29. set_error_handler("anyError", E_ALL);
  30.  
  31.  
  32. $result=mysqli_query($yhteys,"select * from jesse1710_vieraskirja");
  33. print "<table>";
  34.  
  35. while($rivi=mysqli_fetch_object($result)){
  36.     print "<tr>"; print "<form action='moderointi.php' method='post'>";
  37.                 print "<input type='hidden' value='155'>";
  38.                 print "<input type='submit' value='Hyvaksy'>";
  39.                 print "</form>";</tr>";
  40.    
  41. }
  42.  
  43. print "</table>";
  44.  
  45.  
  46.  
  47. mysqli_stmt_close($stmt);
  48. mysqli_close($yhteys);
  49.  
  50.  
  51. exit;
  52. ?>
  53.  
  54. <?php
  55. function anyError($level, $message){
  56.     print "function anyError".$message;
  57. }
  58. ?>
  59. </body>
  60. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement