Don Diego Posted March 21, 2007 Share Posted March 21, 2007 I have a form with one box into which users type a few words (an email address). That entry is emailed to me. I need to copy each entry into one text file automatically so I do not have to copy them manually out of each email one at a time. The result would be one text file with the entries listed down the page, one by one. Any suggestions on how to get started? Link to comment https://forums.phpfreaks.com/topic/43716-solved-form-entry-list/ Share on other sites More sharing options...
tippy_102 Posted March 21, 2007 Share Posted March 21, 2007 This example from the php.net fwrite page should get your started. If you need help, post your code. <?php $filename = 'test.txt'; $somecontent = "Add this to the file\n"; // Let's make sure the file exists and is writable first. if (is_writable($filename)) { // In our example we're opening $filename in append mode. // The file pointer is at the bottom of the file hence // that's where $somecontent will go when we fwrite() it. if (!$handle = fopen($filename, 'a')) { echo "Cannot open file ($filename)"; exit; } // Write $somecontent to our opened file. if (fwrite($handle, $somecontent) === FALSE) { echo "Cannot write to file ($filename)"; exit; } echo "Success, wrote ($somecontent) to file ($filename)"; fclose($handle); } else { echo "The file $filename is not writable"; } ?> http://ca.php.net/manual/en/function.fwrite.php Link to comment https://forums.phpfreaks.com/topic/43716-solved-form-entry-list/#findComment-212243 Share on other sites More sharing options...
Don Diego Posted March 22, 2007 Author Share Posted March 22, 2007 Thank you Tippy_102. That did it. Link to comment https://forums.phpfreaks.com/topic/43716-solved-form-entry-list/#findComment-212594 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.