Re: [PHP] Sending Form Result to File
just pico a file called myforms.csv or something. use the first line for you schema... "name","date","comments","etc" chmod the file to rw permissions or chown to nobody. $file = fopen("/home/myaccnt/public_html/protected/myforms.csv", "w"); fputs($file, "\n\"$form_name\",\"$form_date\",\"$form_comments\",\$form_etc\""); fclose($file); - Original Message - From: "Ben Clumeck" <[EMAIL PROTECTED]> To: "PHP General" <[EMAIL PROTECTED]> Sent: Thursday, November 29, 2001 5:34 PM Subject: [PHP] Sending Form Result to File > I am looking for a script to send my form results to a .txt file in CSV (to > import into Excel) format. Does anyone have a simple code? > > Ben > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Sending Form Result to File
caveats ... it just assumes you'll figure out the output from the form data -- filenames will be random .txt files written to the /tmp directory (which avoids all kinds of permission problems I'd otherwise need to discuss). uses the "|" (pipe) character instead of commas so you can have commas in the output itself ... I believe that Excel allows you to choose the delimiter, so that shouldn't be a problem. I did no error checking on the open or put statements ... you really should in a production script. On Thu, Nov 29, 2001 at 04:34:06PM -0800, Ben Clumeck wrote: > I am looking for a script to send my form results to a .txt file in CSV (to > import into Excel) format. Does anyone have a simple code? > > Ben > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > -- Hank Marquardt <[EMAIL PROTECTED]> http://web.yerpso.net GPG Id: 2BB5E60C Fingerprint: D807 61BC FD18 370A AC1D 3EDF 2BF9 8A2D 2BB5 E60C *** Web Development: PHP, MySQL/PgSQL - Network Admin: Debian/FreeBSD *** PHP Instructor - Intnl. Webmasters Assn./HTML Writers Guild *** Beginning PHP -- Starts January 7, 2002 *** See http://www.hwg.org/services/classes -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Sending Form Result to File
I am looking for a script to send my form results to a .txt file in CSV (to import into Excel) format. Does anyone have a simple code? Ben -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]