<?php if (isset($_POST['submit'])) { $tekstas = $_POST['tekstas']; $failas = fopen("failas.txt", "a+"); $rasom = fwrite ($failas, "\n$tekstas"); fclose ($failas); } ?> <form name="tekstas" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>"> <input type="text" name="tekstas" value="" /> <input type="submit" name="submit" value="" /> </form>