RE: Seeking a function, class or other means to save the current PHP page as an HTML file on the server.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks so much to all for the replies...

 

Michael's method works work for a static page... but as the (*.php) page
gets data from a PostgreSQL database to display it "breaks", not
unreasonably, when it is saved using this method as a *.html.

 

Fun to learn new stuff... I am off to try and learn how I can make this
work, with the leads provided...    :-)

 

In the *meantime*, under the "Save As HTML" icon I have put some text
letting the user know about File... Save Page As... (or ... Save As...)

 

I am going to look at maybe using this method with a PDF generation
method to 'make' the page as a PDF for them to download...

 

Thanks again... what a resource...

 

Regards,

GREG COCKS

gcocks | at | stoller.com <mailto:gcocks@xxxxxxxxxxx> 

 

________________________________

From: Michael Southworth [mailto:mikesouthworth@xxxxxxxxx] 
Sent: Thursday, March 06, 2008 6:40 PM
To: Greg Cocks
Cc: php-windows@xxxxxxxxxxxxx
Subject: Re:  Seeking a function, class or other means to save
the current PHP page as an HTML file on the server.

 

As a quick answer, I think the easiest way is to have a link reload the
page, with a flag to set the content disposition header.
See:
http://us3.php.net/header
Example #1
It should be fairly straightforward from there. If I do recall, there
may be some quirks with IE, a quick google should bring up any
workarounds.

If you cannot allow a refresh, the solution may be far more complicated,
using the document object model in javascript, or php output control. In
that case, I would ask your users to just use the Save-as function
instead.

HTH,
-Michael

On Thu, Mar 6, 2008 at 5:21 PM, Greg Cocks <gcocks@xxxxxxxxxxx> wrote:

Hello,



I am seeking a function, class or other means to save the current PHP
page as an HTML file on the server.



The user, via a button, could then 'download' this page much like if
they had gone to their "File... Save Page As.." menu to save it locally.



This is for a (dynamic) page that I have written in PHP that formats and
presents some query results - and the results presented vary based on
the user's selection of parameters on an earlier page.



Any suggestions?



This 'one click' menu is for users "resistant" to learning how to do the
"File... Save Page As..." method...



Thanks in advance!



----------
Regards,
GREG COCKS
GIS Analyst V
gcocks | at | stoller.com <blocked::mailto:gcocks@xxxxxxxxxxx>
S. M. Stoller Corp
105 Technology Drive, Suite 190
Broomfield, CO 80021
www.stoller.com <blocked::http://www.stoller.com/>
303-546-4300
303-443-1408 fax
303-546-4422 direct
303-828-7576 cell




 


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux