
<form method="post" action="action.php"> <input type="text" name="filename" value="File name"> <br> <textarea name="theText" cols="35" rows="15">File data </textarea> <br> <input type="submit" value="Post Data"> </form>Once you have your form done, you can make the action.php file refered to in the form tag.
<? $filename = $_POST["filename"]; $theText = $_POST["theText"]; $theText = stripslashes($theText); $data = fopen($filename, "a"); fwrite($data,$theText); fclose($data); echo "File created or updated"; ?>What the above code code does is gets the file name you specified in the form, opens or creates it, then adds the data you entered. If the file already exists, then it'll add on to the bottom of that file. The stripslashes code is to make the html code work properly, so leave it there.
Copyright © 2000-2008 Spoono, LLC. All rights reserved.
Network: Reseller Web Hosting by Spoono Host | Spoonloads | Absolute Cross
Terms of Service | Privacy Policy.