Reply to Re: Write to CSV

Your name:

Reply:


Posted by Andy on 09/18/05 19:40

"sumeet" <sumeet72@gmail.com> wrote in message
news:dgj8ca$3pk$1@domitilla.aioe.org...
> Andy wrote:
>> "Andy" <Andy@invalid.com> wrote in message
>> news:3MSdndBSZMHul7DeRVn-sg@rogers.com...
>>
>>>I want to capture information from a form and write that to a CSV. Could
>>>you give me a simple script to do it. For example how to capture email
>>>address from a form. Thank You in advance.
>>>
>>
>>
>> I got it LOL.
>>
>> $filename = "anything.csv";
>> touch ("$filename");
>> $fpc = fopen($filename, "a") or die ("Couldn't open $filename");
>> fputs($fpc,"\n$_POST[from], $_POST[email], $_POST[subject],
>> $_POST[message]");
>> fclose($fpc);
>
> there is only one problem. suppose 'subject' or 'message' contains a comma
> i.e. 'Las Vegas Crime Lab, USA'.
>
> solution
> fputs($fpc,"\n\"$_POST[from]\", $_POST[email], \"$_POST[subject]\",
> \"$_POST[message]\"");
>
> sumeet shroff
>
>
You are right. Thank you. I will fix it.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация