form to file script. php or html<

liunx

Guest
Hey, Im looking for a html, or php simple script that will be able to have a form with a field, that when submitted will send it to a text file on my server. the php or html script will also be on the same server.

Also it needs to replace everything else in the text file when a new thing is submitted.

Ive tried searching and couldnt find anything.
Any help would be appreciated.well the process part need to be in php (or any serverside language)

look at the fopen() function with the mode 'w+'i dont know any php. would u mind posting a code snippet that would work.<?php
if (isset($_POST['form_text']))
{
$file = fopen('myfile.txt','w+');
fwrite($file,$_POST['form_text']);
fclose($file);
}
?>
<html>
<body>
<form method="post">
<input type="text" name="form_text">
<input type="submit">
</form>
</body>
</html>


<!-- m --><a class="postlink" href="http://ca3.php.net/fwrite">http://ca3.php.net/fwrite</a><!-- m -->
 
Back
Top