Hi Ben,

@ 6:08:20 PM on 11/19/2001, Ben Clumeck wrote:

BC> Does anybody have an easy script that send form results to a .txt file in
BC> comma separated format.

Be careful with commas in any of the fields. You may want to separate
the fields with something like | or :: instead.

<?php

/* in place of live post or get: */
$from_post_or_get = array('john','doe','red bud lane','555-555-5555');

if(! $p = @fopen('/path/to/csv/file','a')) die("can't do it\n");
$line = implode(',',$from_post_or_get) . "\n";
fputs($p,$line,1024); // or: fputs($fp,$line,strlen($line));
fclose($p);

?>

<http://www.php.net/manual/en/function.fgetcsv.php>

--
 -Brian Clark | PGP is spoken here: 0xE4D0C7C8
  Please, DO NOT carbon copy me on list replies.


-- 
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