Skip to main content
Inspiring
October 2, 2006
Question

OT: interesting problem and a solution

  • October 2, 2006
  • 9 replies
  • 523 views
I have a site that I want to bring under template control. Some pages will
be HTML pages. Some pages will be PHP pages. I want to use INCLUDES with
the site (it's a rebuild of an existing site).

If I use HTML SSI, that works fine, but only in pages with *.html
extensions. If I use PHP SSI, those don't work at all in *.html pages.
What to do?

I use *BOTH*, like this -

<!--#include virtual="/includes/whatever.html" -->
<!--<?php include="/includes/whatever.html" ?>-->

HTML files recognize the HTML SSI and ignore the PHP one since it's in an
HTML comment. PHP pages ignore the HTML SSI, and execute the PHP one,
ignoring the fact that it's in an HTML comment.

This way, I can have both includes within the non-editable regions and I'm
laughing....

Do you see any downside to doing it this way?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================



This topic has been closed for replies.

9 replies

Inspiring
October 3, 2006
Much harder to do on a Windows server....

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"Joe Makowiec" <makowiec@invalid.invalid> wrote in message
news:Xns9850D9C31406BmakowiecatnycapdotrE@216.104.212.96...
> On 02 Oct 2006 in macromedia.dreamweaver.appdev, Murray *ACE* wrote:
>
>>> Could you not tell the server to access html files as PHP files?
>>> (Or allow PHP code to be executed in HTML files?)
>>
>> This may be how I have to do it....
>
> If you've got SSIs working in files with extension .html, you're already
> convincing the server that they're server-parsed HTML (.shtml), so it's
> only a small step to change that to PHP. I still like rewriting *.html
> to *.php, though.
>
> --
> Joe Makowiec
> http://makowiec.net/
> Email: http://makowiec.net/email.php


Inspiring
October 3, 2006
On 02 Oct 2006 in macromedia.dreamweaver.appdev, Murray *ACE* wrote:

>> Could you not tell the server to access html files as PHP files?
>> (Or allow PHP code to be executed in HTML files?)
>
> This may be how I have to do it....

If you've got SSIs working in files with extension .html, you're already
convincing the server that they're server-parsed HTML (.shtml), so it's
only a small step to change that to PHP. I still like rewriting *.html
to *.php, though.

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/email.php
Inspiring
October 2, 2006
> Could you not tell the server to access html files as PHP files? (Or allow
> PHP code to be executed in HTML files?)

This may be how I have to do it....

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"crash" <crash@bcdcdigital.com> wrote in message
news:efrpin$mm1$1@forums.macromedia.com...
> ROFL, sorry mate!
>
> Could you not tell the server to access html files as PHP files? (Or allow
> PHP code to be executed in HTML files?)
>
> That seems like it would be the ideal situation to me, but I'm not sure
> how Windows handles that.
>
> Jon
>
> "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
> news:efrovf$m0g$1@forums.macromedia.com...
>> Problem is, it doesn't work! 8(
>>
>> --
>> Murray --- ICQ 71997575
>> Adobe Community Expert
>> (If you *MUST* email me, don't LAUGH when you do so!)
>> ==================
>> http://www.dreamweavermx-templates.com - Template Triage!
>> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
>> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
>> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
>> ==================
>>
>>
>> "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
>> news:efro1j$ksk$1@forums.macromedia.com...
>>> It's an existing site, on a Windows server. I don't want to rename
>>> files. And I don't want to use multiple templates.
>>>
>>> --
>>> Murray --- ICQ 71997575
>>> Adobe Community Expert
>>> (If you *MUST* email me, don't LAUGH when you do so!)
>>> ==================
>>> http://www.dreamweavermx-templates.com - Template Triage!
>>> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
>>> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
>>> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
>>> ==================
>>>
>>>
>>> "Tom Muck" <tommuck@NOSPAM.basic-drumbeat.com> wrote in message
>>> news:efrnek$k67$1@forums.macromedia.com...
>>>>> HTML files recognize the HTML SSI and ignore the PHP one since it's in
>>>>> an HTML comment. PHP pages ignore the HTML SSI, and execute the PHP
>>>>> one, ignoring the fact that it's in an HTML comment.
>>>>>
>>>>> This way, I can have both includes within the non-editable regions and
>>>>> I'm laughing....
>>>>>
>>>>> Do you see any downside to doing it this way?
>>>>
>>>> Seems a bit odd to me. Why not just use a PHP templating system instead
>>>> with includes for design elements? Why have HTML pages at all in a PHP
>>>> site?
>>>>
>>>>
>>>> --
>>>> Tom Muck
>>>> co-author Dreamweaver MX 2004: The Complete Reference
>>>> http://www.tom-muck.com/
>>>>
>>>> Cartweaver Development Team
>>>> http://www.cartweaver.com
>>>>
>>>> Extending Knowledge Daily
>>>> http://www.communitymx.com/
>>>>
>>>
>>>
>>
>>
>
>


Inspiring
October 2, 2006
ROFL, sorry mate!

Could you not tell the server to access html files as PHP files? (Or allow
PHP code to be executed in HTML files?)

That seems like it would be the ideal situation to me, but I'm not sure how
Windows handles that.

Jon

"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:efrovf$m0g$1@forums.macromedia.com...
> Problem is, it doesn't work! 8(
>
> --
> Murray --- ICQ 71997575
> Adobe Community Expert
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
> http://www.dreamweavermx-templates.com - Template Triage!
> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
> ==================
>
>
> "Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
> news:efro1j$ksk$1@forums.macromedia.com...
>> It's an existing site, on a Windows server. I don't want to rename
>> files. And I don't want to use multiple templates.
>>
>> --
>> Murray --- ICQ 71997575
>> Adobe Community Expert
>> (If you *MUST* email me, don't LAUGH when you do so!)
>> ==================
>> http://www.dreamweavermx-templates.com - Template Triage!
>> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
>> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
>> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
>> ==================
>>
>>
>> "Tom Muck" <tommuck@NOSPAM.basic-drumbeat.com> wrote in message
>> news:efrnek$k67$1@forums.macromedia.com...
>>>> HTML files recognize the HTML SSI and ignore the PHP one since it's in
>>>> an HTML comment. PHP pages ignore the HTML SSI, and execute the PHP
>>>> one, ignoring the fact that it's in an HTML comment.
>>>>
>>>> This way, I can have both includes within the non-editable regions and
>>>> I'm laughing....
>>>>
>>>> Do you see any downside to doing it this way?
>>>
>>> Seems a bit odd to me. Why not just use a PHP templating system instead
>>> with includes for design elements? Why have HTML pages at all in a PHP
>>> site?
>>>
>>>
>>> --
>>> Tom Muck
>>> co-author Dreamweaver MX 2004: The Complete Reference
>>> http://www.tom-muck.com/
>>>
>>> Cartweaver Development Team
>>> http://www.cartweaver.com
>>>
>>> Extending Knowledge Daily
>>> http://www.communitymx.com/
>>>
>>
>>
>
>


Inspiring
October 2, 2006
Problem is, it doesn't work! 8(

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:efro1j$ksk$1@forums.macromedia.com...
> It's an existing site, on a Windows server. I don't want to rename files.
> And I don't want to use multiple templates.
>
> --
> Murray --- ICQ 71997575
> Adobe Community Expert
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
> http://www.dreamweavermx-templates.com - Template Triage!
> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
> http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
> ==================
>
>
> "Tom Muck" <tommuck@NOSPAM.basic-drumbeat.com> wrote in message
> news:efrnek$k67$1@forums.macromedia.com...
>>> HTML files recognize the HTML SSI and ignore the PHP one since it's in
>>> an HTML comment. PHP pages ignore the HTML SSI, and execute the PHP
>>> one, ignoring the fact that it's in an HTML comment.
>>>
>>> This way, I can have both includes within the non-editable regions and
>>> I'm laughing....
>>>
>>> Do you see any downside to doing it this way?
>>
>> Seems a bit odd to me. Why not just use a PHP templating system instead
>> with includes for design elements? Why have HTML pages at all in a PHP
>> site?
>>
>>
>> --
>> Tom Muck
>> co-author Dreamweaver MX 2004: The Complete Reference
>> http://www.tom-muck.com/
>>
>> Cartweaver Development Team
>> http://www.cartweaver.com
>>
>> Extending Knowledge Daily
>> http://www.communitymx.com/
>>
>
>


Inspiring
October 2, 2006
It's an existing site, on a Windows server. I don't want to rename files.
And I don't want to use multiple templates.

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com - Template Triage!
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
http://www.macromedia.com/support/search/ - Macromedia (MM) Technotes
==================


"Tom Muck" <tommuck@NOSPAM.basic-drumbeat.com> wrote in message
news:efrnek$k67$1@forums.macromedia.com...
>> HTML files recognize the HTML SSI and ignore the PHP one since it's in an
>> HTML comment. PHP pages ignore the HTML SSI, and execute the PHP one,
>> ignoring the fact that it's in an HTML comment.
>>
>> This way, I can have both includes within the non-editable regions and
>> I'm laughing....
>>
>> Do you see any downside to doing it this way?
>
> Seems a bit odd to me. Why not just use a PHP templating system instead
> with includes for design elements? Why have HTML pages at all in a PHP
> site?
>
>
> --
> Tom Muck
> co-author Dreamweaver MX 2004: The Complete Reference
> http://www.tom-muck.com/
>
> Cartweaver Development Team
> http://www.cartweaver.com
>
> Extending Knowledge Daily
> http://www.communitymx.com/
>


Inspiring
October 2, 2006
On 02 Oct 2006 in macromedia.dreamweaver.appdev, Murray *ACE* wrote:

> Do you see any downside to doing it this way?

What Muck said. Is this on an Apache server? If so, do a MOD_REWRITE
from *.html to *.php, possibly with a 301 thrown in.

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/email.php
Inspiring
October 2, 2006
>> Do you see any downside to doing it this way?

It might blow up if it is ever moved to a new server.

I'd either rename your HTML pages, or set up the server to process HTML
pages as PHP pages (the latter likely being the easiest solution).

-Darrel


Inspiring
October 2, 2006
> HTML files recognize the HTML SSI and ignore the PHP one since it's in an
> HTML comment. PHP pages ignore the HTML SSI, and execute the PHP one,
> ignoring the fact that it's in an HTML comment.
>
> This way, I can have both includes within the non-editable regions and I'm
> laughing....
>
> Do you see any downside to doing it this way?

Seems a bit odd to me. Why not just use a PHP templating system instead with
includes for design elements? Why have HTML pages at all in a PHP site?


--
Tom Muck
co-author Dreamweaver MX 2004: The Complete Reference
http://www.tom-muck.com/

Cartweaver Development Team
http://www.cartweaver.com

Extending Knowledge Daily
http://www.communitymx.com/