Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if (isset($_POST['_nazwa']) && trim($_POST['_nazwa'])) {
- $nazwa = trim($_POST['_nazwa']);
- $plik = 'plik.txt';
- $zawartosc = @file_get_contents($plik);
- file_put_contents($plik, $zawartosc . $nazwa . "\n");
- }
- ?>
- <!DOCTYPE html>
- <html lang="pl">
- <head>
- <meta charset="UTF-8">
- <title>Formularz</title>
- </head>
- <body>
- <form action="" method="post">
- <label class="label-input" for="_nazwa">
- Nazwa
- </label>
- <input name="_nazwa" type="text" maxlength="40" id="_nazwa" placeholder="Nazwa">
- <button type="submit">wyslij</button>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment