Re: Creating an Entire .html page with PHP
| From: | clancy_1 at cybec dot com dot au | Date: | Sat, 30 Jan 2010 01:47:25 +0000 |
| Subject: | Re: Creating an Entire .html page with PHP | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-301677@lists.php.net to get a copy of this message | ||
On Thu, 28 Jan 2010 16:23:05 -0500, paulf@quillandmouse.com (Paul M Foster) wrote:
>On Fri, Jan 29, 2010 at 08:17:34AM +1100, clancy_1@cybec.com.au wrote:
>
>> On Thu, 28 Jan 2010 21:10:42 +0100, rene7705@gmail.com (Rene Veerman) wrote:
>>
>> >On Thu, Jan 28, 2010 at 12:31 AM, <clancy_1@cybec.com.au> wrote:
>> >> On Wed, 27 Jan 2010 10:21:00 -0800, dealtek@gmail.com (dealtek) wrote:
>> >>Opening tables, etc, wrongly generally messes the page up completely, but
>> >> forgetting to close them again often has no affect no visible effect
>> at all -- until you
>> >> make some innocent change and everything goes haywire!
>> >
>> >whenever i write an opening tag, i immediately write the closing tag
>> >next, then cursor back to fill it in.
>>
>> Not so easy when you are using PHP to generate a complex layout!
>
>Use heredocs to do it. Then you can generate the layout in PHP and still
>do what dealtek@gmail.com said.
I don't think heredocs is relevant. The original writer wanted to save the HTML output of
a working page to a file, whereas (I think!) heredocs are involved with getting messy
stuff into PHP.
I still think that simply capturing the page from the browser is the simplest solution for
the original question, but if you want a more elegant one see:
http://codeutopia.net/blog/2007/10/03/how-to-easily-redirect-php-output-to-a-file/
The writer appears to know what he's talking about, and I am pleased to have found this,
as I have often wanted to to redirect PHP output to a file.