Re: Re: how to send entire php webpage content to another page?
| From: | Bogdan Stancescu | Date: | Thu, 27 Nov 2003 14:58:10 +0000 |
| Subject: | Re: Re: how to send entire php webpage content to another page? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-171214@lists.php.net to get a copy of this message | ||
Well, you have three solutions. One, you finish it the way you started, in which case you'll need to use htmlspecialchars() on $out in the form (otherwise you'll almost certainly escape from the form tag sooner or later). Two, you store the data temporarily in a database or something (faster for the user, they don't get to download the data twice). Three, you re-generate this page on request. This is what I would do, personally: I would link to the same page, only sending some parameter (e.g. "&xls_output=true"). Then, at the beginning of the page you can test for $xls_output and simply dump them headers in front of the whole shebang if needed.
HTH
Bogdan
Joffrey Leevy wrote:
Most humble apologies. Trying to create an excel file of the current php page which can be downloaded. What I've been doing is creating an output buffer and then using ob_get_clean to retrieve the page contents. for example, $out=ob_get_clean(); Now everything works up to there, but when I try to post $out in a hidden form to another page it doesn't work. echo "<formaction='nextpage.php' method='post'><input type='hidden' name='out' value='$out'> <input type='submit' value = 'save as xls file'> </form>\n";And on nextpage.php I have <?php header("Content-type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=\"test.xls\""); echo $out; ?> To make a long story short, this does not work. Grateful for any help. --- Bogdan Stancescu <gutza@moongate.ro> wrote:You didn't provide much help by not answering the very question in the title. _HOW_ would you want to send it? Via a POST variable? Internally, via a plain text file? Internally, via memory sharing? Via e-mail? Also, it would be interesting to know what exactly you're after, that could help people maybe suggest some alternate methods to what you're currently trying. Are you trying to back up data? Replicate? Synchronize? Bogdan Joffrey Leevy wrote:__________________________________ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/Hi: Does anyone have info on sending the contents ofanentire php webpage to another php page on the same server? A little code would be helpful. Thanks __________________________________ Do you Yahoo!? Free Pop-Up Blocker - Get it now http://companion.yahoo.com/-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php