I copied this code from Captain Morgan. The problem I am having is that nothing ever gets written in the data.txt file. I am a newbie trying to learn php. Other than this file and my data.txt file, is their any other files I need to create? Code I am using: <?php $saving = $_REQUEST['saving']; if ($saving == 1){ $data = $_POST['data']; $file = "data.txt"; $fp = fopen($file, "a") or die("Couldn't open $file for writing!"); fwrite($fp, $data) or die("Couldn't write values to file!"); fclose($fp); echo "Saved to $file successfully!"; } ?> <form name="form1" method="post" action="index2.php?saving=1"> <textarea name="data" cols="100" rows="10"> Vehicle Make: Vehicle Model: --------------------------------------------- </textarea> <br> <input type="submit" value="Save"> </form> <p> <a href="http://www.richu.5gbfree.com/data.txt"><b>VIEW<b></a> Your help is deeply appreciated.
Do you have your "data.txt" enabled as writeable on your server??? Chmod it to 777 or set it manualy in your ftp client to writeable.
I'm guessing file permissions as well. Check your servers error logs to see if anything shows up that would be more helpful.
Thank you for your ideas. The problem was that I misspelled 'index2.php'. I forgot the '2'. Once this was corrected, the script worked.