PHP Creating and editing TXT file -
i have tried everything, , multiple different source codes, have tried creating file php had write in it, , still unable it.
this html on index.html
<form name="userinput" action="usersave.php" method="post"> name: <input type="text" name="username><br> email: <input type="text" name="useremail"><br> story: <textarea rows="3" cols="50" name="userstory"></textarea><br> <input type="submit" value="submit!" name="submit"> </form> and php on usersave.php
<header> <?php $file = 'output.txt'; $buffer = $_post['userstory']; if (file_exists($file)) { $buffer = file_get_contents($file) . "\n" . $buffer; } $success = file_put_contents($file, $buffer); ?> </header> any appreciated, please , thank you.
edit: you'll need install sort of server environment started.
i recommend wamp
Comments
Post a Comment