|
Posted by Carl on 05/22/07 18:46
Truck Estevez <oohtruck@gmail.com> writes:
> Hey, intermediate php/mysql user here. I have a mailing list form on
> my website, what i'd ultimately like to happen is when the user
> submits their information that all goes into the database. The tricky
> part is i'd like it so for my clients, they can go to an admin utility
> and press an "export" button and have it spit out the data from that
> form, into either an excel doc or a csv, whatever is easiest... any
> suggestions on how to do this?
>
> Truck
Hi Truck,
This should be quite simple if you go with csv.
Basically, you just send to content of your document
to the client just like you would a webpage, the key
is setting the correct headers so that the browser
knows what to do with it.
Take a look at the php docs for the header() function.
http://php.net/header
I think you'll want to start by setting the "content-type",
"content-length" and "content-disposition". You may also
need to set others depending on the browser.
Hope that helps,
Carl.
Navigation:
[Reply to this message]
|