From: clancy_1 on 29 Jan 2010 20:47 On Thu, 28 Jan 2010 16:23:05 -0500, paulf(a)quillandmouse.com (Paul M Foster) wrote: >On Fri, Jan 29, 2010 at 08:17:34AM +1100, clancy_1(a)cybec.com.au wrote: > >> On Thu, 28 Jan 2010 21:10:42 +0100, rene7705(a)gmail.com (Rene Veerman) wrote: >> >> >On Thu, Jan 28, 2010 at 12:31 AM, <clancy_1(a)cybec.com.au> wrote: >> >> On Wed, 27 Jan 2010 10:21:00 -0800, dealtek(a)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(a)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.
From: Nisse =?utf-8?Q?Engstr=C3=B6m?= on 30 Jan 2010 13:20 On Fri, 29 Jan 2010 14:48:47 +0000, Ashley Sheridan wrote: > On Fri, 2010-01-29 at 20:15 +0530, Raman . wrote: > >> you can use Apache mod rewrite to create html pages having all programing >> saved in .php pages. I have never tried generating .html pages with this but >> have successfully generated .htm pages.. > > You still have to create .php pages, mod_rewrite just masks what the > user is requesting through their browser. You can set Apache to > parse .html pages as PHP, but I wouldn't recommend it, as any html pages > that don't contain PHP code still have to be parsed as if they did, > which is slower. ..htaccess: DirectoryIndex index.php /Nisse
From: Ashley Sheridan on 30 Jan 2010 13:16 On Sat, 2010-01-30 at 19:20 +0100, Nisse Engström wrote: > On Fri, 29 Jan 2010 14:48:47 +0000, Ashley Sheridan wrote: > > > On Fri, 2010-01-29 at 20:15 +0530, Raman . wrote: > > > >> you can use Apache mod rewrite to create html pages having all programing > >> saved in .php pages. I have never tried generating .html pages with this but > >> have successfully generated .htm pages.. > > > > You still have to create .php pages, mod_rewrite just masks what the > > user is requesting through their browser. You can set Apache to > > parse .html pages as PHP, but I wouldn't recommend it, as any html pages > > that don't contain PHP code still have to be parsed as if they did, > > which is slower. > > .htaccess: > DirectoryIndex index.php > > > /Nisse > That would only set the index for a given directory, it doesn't force Apache to run that script when something else is called. Thanks, Ash http://www.ashleysheridan.co.uk
From: Robert Cummings on 30 Jan 2010 13:40 Ashley Sheridan wrote: > On Sat, 2010-01-30 at 19:20 +0100, Nisse Engström wrote: > >> On Fri, 29 Jan 2010 14:48:47 +0000, Ashley Sheridan wrote: >> >>> On Fri, 2010-01-29 at 20:15 +0530, Raman . wrote: >>> >>>> you can use Apache mod rewrite to create html pages having all programing >>>> saved in .php pages. I have never tried generating .html pages with this but >>>> have successfully generated .htm pages.. >>> You still have to create .php pages, mod_rewrite just masks what the >>> user is requesting through their browser. You can set Apache to >>> parse .html pages as PHP, but I wouldn't recommend it, as any html pages >>> that don't contain PHP code still have to be parsed as if they did, >>> which is slower. >> .htaccess: >> DirectoryIndex index.php >> >> >> /Nisse >> > > That would only set the index for a given directory, it doesn't force > Apache to run that script when something else is called. I answered this issue yesterday with the following: AddType application/x-httpd-php .php .html .htm I think tedd also adds .css :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP
From: Ashley Sheridan on 30 Jan 2010 13:37
On Sat, 2010-01-30 at 13:40 -0500, Robert Cummings wrote: > Ashley Sheridan wrote: > > On Sat, 2010-01-30 at 19:20 +0100, Nisse Engström wrote: > > > >> On Fri, 29 Jan 2010 14:48:47 +0000, Ashley Sheridan wrote: > >> > >>> On Fri, 2010-01-29 at 20:15 +0530, Raman . wrote: > >>> > >>>> you can use Apache mod rewrite to create html pages having all programing > >>>> saved in .php pages. I have never tried generating .html pages with this but > >>>> have successfully generated .htm pages.. > >>> You still have to create .php pages, mod_rewrite just masks what the > >>> user is requesting through their browser. You can set Apache to > >>> parse .html pages as PHP, but I wouldn't recommend it, as any html pages > >>> that don't contain PHP code still have to be parsed as if they did, > >>> which is slower. > >> .htaccess: > >> DirectoryIndex index.php > >> > >> > >> /Nisse > >> > > > > That would only set the index for a given directory, it doesn't force > > Apache to run that script when something else is called. > > I answered this issue yesterday with the following: > > AddType application/x-httpd-php .php .html .htm > > I think tedd also adds .css :) > > Cheers, > Rob. > -- > http://www.interjinn.com > Application and Templating Framework for PHP > I thought that doing that introduced slowdowns where Apache was parsing html files that didn't contain PHP code though? Thanks, Ash http://www.ashleysheridan.co.uk |