gentlemanintraining Posted October 15, 2006 Share Posted October 15, 2006 I'm trying to create a form where users can submit information to a database, but one of the forms (a textarea) has to generate a text file. How do I get data within a textarea box to generate a randomly titled text file? I'd also like to know how I can get the file-name of that generated text file, so I can add it to MySQL. Link to comment https://forums.phpfreaks.com/topic/23991-moving-data-within-a-textarea-field-to-a-text-file/ Share on other sites More sharing options...
Daniel0 Posted October 15, 2006 Share Posted October 15, 2006 [code]<?php$filename = md5(microtime());$fp = fopen("files/{$filename}",'w');fwrite($fp,$_POST['file_contents']);flclose($fp);mysql_query("INSERT INTO ......");?>[/code] Link to comment https://forums.phpfreaks.com/topic/23991-moving-data-within-a-textarea-field-to-a-text-file/#findComment-109009 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.