|
Posted by Kimmo Laine on 07/28/06 10:40
"strawberry" <zac.carey@gmail.com> wrote in message
news:1154080399.591498.91400@75g2000cwc.googlegroups.com...
Kimmo Laine wrote:
> "strawberry" <zac.carey@gmail.com> wrote in message
> news:1154074574.791314.102370@i3g2000cwc.googlegroups.com...
> > I've written a (single-page) script that works like this;
> >
> > If no values are posted to it, the script creates a form page for a
> > user to fill in and 'submit'.
> >
> > If values are posted to it (i.e. the user filled in the form), the
> > script renders a page of html with the user-supplied values.
> >
> > Straightforward stuff, however, if values are posted I'd like the
> > rendered page to open in MS word for further editing, instead of the
> > users default browser.
> >
> > What steps can I take to acheve this?
>
>
> Make an .rtf-document. You can start by making a template in Wordpad or
> Word, save the file as rtf and open it, it's just plaintext. Copy it and
> paste it to your php file, then insert required php magic in the rtf (echo
> the user input values to right places) and finally make it look like rtf
> document with headers.
>
> header('Content-type: application/msword');
> header('Content-Disposition: attachment; filename="myfile.rtf"');
> header('Cache-Control: private');
>
> This is at least how I've managed to do it. The only hard part is the rtf
> which has quite messy markup.
>
>
> Thanks for the reply Kimmo,
>
> So, wouldn't this work - if it only appeared in the 'values posted'
> case?
As a wise man once said, "Well, duh!". I thought it was kinda obvious but
apparently it wasn't. Yes, only in the case if values are posted.
--
"Ohjelmoija on organismi joka muuttaa kofeiinia koodiksi" - lpk
http://outolempi.net/ahdistus/ - Satunnaisesti pδivittyvδ nettisarjis
spam@outolempi.net || Gedoon-S @ IRCnet || rot13(xvzzb@bhgbyrzcv.arg)
Navigation:
[Reply to this message]
|