ianco Posted December 5, 2009 Share Posted December 5, 2009 Hi all, I want to create a form with a textbox and text area that can save the data as a txt file. I want the textbox entry to be the name of the file; ie. if the entry was joebloggs then the file would be joebloggs.txt The php i have so far is <?php $wam = htmlspecialchars($_POST['wam']) ; $info = htmlspecialchars($_POST['info']) ; $myFile = "temp.txt"; $fh = fopen($myFile, 'w') or die("can't open file"); $news = stripslashes($_POST['news']); htmlspecialchars($news, ENT_NOQUOTES); fwrite($fh, $news); fclose($fh); ?> So how would i modify it to allow the wam output to be the name of the file? Cheers Link to comment https://forums.phpfreaks.com/topic/184084-save-form-data-with-different-file-names/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.