Guest User

Untitled

a guest
Jan 17th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  1. <?php
  2.  
  3. if (isset($_POST['_nazwa']) && trim($_POST['_nazwa'])) {
  4.     $nazwa = trim($_POST['_nazwa']);
  5.     $plik = 'plik.txt';
  6.     $zawartosc = @file_get_contents($plik);
  7.     file_put_contents($plik, $zawartosc . $nazwa . "\n");
  8. }
  9.  
  10. ?>
  11. <!DOCTYPE html>
  12. <html lang="pl">
  13. <head>
  14.     <meta charset="UTF-8">
  15.     <title>Formularz</title>
  16. </head>
  17. <body>
  18. <form action="" method="post">
  19.     <label class="label-input" for="_nazwa">
  20.         Nazwa
  21.     </label>
  22.     <input name="_nazwa" type="text" maxlength="40" id="_nazwa" placeholder="Nazwa">
  23.     <button type="submit">wyslij</button>
  24. </form>
  25. </body>
  26. </html>
Advertisement
Add Comment
Please, Sign In to add comment