|
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.
Navigation:
[Reply to this message]
|