<?php
$fd = fopen("/tmp/myformoutputdirectory/".md5(microtime()).".txt","w+");
fputs($fd,implode("|",$HTTP_POST_VARS));
fclose($fd);
?>

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]

Reply via email to