Facebook
From Putrid Meerkat, 1 Year ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 122
  1. <html>
  2. <head>
  3. </head>
  4. <body>
  5. <form action="formularz.php" method="post">
  6. Podaj swoją opinię<br>
  7. <textarea wrap="wirtual" name="opinia" cols="50" rows="10"></textarea>
  8. <input type="submit" name="potwierdz" value="Potwierdź"/>
  9. <form>
  10. <?php
  11. $x=$_POST['opinia'];
  12. if(isset ($x))
  13. {
  14.         $tekst=substr($x,0,255);
  15.         $tekst=strip_tags($tekst)."\n";
  16.         if(!$op=fopen('opinie.txt','a'))
  17.         {
  18.                 echo 'Błąc nie można otworzyć pliku';
  19.         }
  20.         else
  21.                 if (fwrite($op,$tekst)==false)
  22.                         {
  23.                         echo 'Nie dodano komentarza';
  24.                         }
  25.         else
  26.         {
  27.                 echo 'Dodano opinie';
  28.                 fclose($op);
  29.         }
  30. }
  31.  
  32. ?>
  33.  
  34. </body>
  35. </html>