Forum Moderators: coopster

Message Too Old, No Replies

PHP includes vs. ordinary html SSI includes

A mix of HTML and PHP pages... best route to take for includes

         

Asia_Expat

9:50 pm on Apr 17, 2006 (gmt 0)

10+ Year Member



I have a mix of HTML pages and PHP renamed pages.
I'm developing a system of standard footers to help me maintain the site. on the PHP pages, I will use...

<?php require("http://www.myurl.info/footer.html");?>

However, for the HTML pages do you think it would be best to enable PHP in HTML pages via htaccess control file and include the above, or should I set up to parse html as shtml and do it the other way. I know that both would work but I invite comment on the cleanest method.

Thanks :-)

henry0

10:38 pm on Apr 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Avoid mixing includes PHP and SHTML
by allowing both to be parsed may lead to quite some problems.

Best route: Parse HTML as PHP

Asia_Expat

1:13 am on Apr 18, 2006 (gmt 0)

10+ Year Member



That's what I figured... thanks :)

Asia_Expat

1:46 am on Apr 18, 2006 (gmt 0)

10+ Year Member



After making html pages parse PHP, I notince the following changes in the header. Should I be concerned by them? I know almost nothing about this...

Before...

HTTP/1.1 200 OK
Date: Tue, 18 Apr 2006 01:43:48 GMT
Server: Apache/1.3.33 (Unix)
Last-Modified: Tue, 18 Apr 2006 00:41:27 GMT
ETag: "10b8bb-1274-444435b7"
Accept-Ranges: bytes
Content-Length: 4724
Keep-Alive: timeout=2, max=200
Connection: Keep-Alive
Content-Type: text/html

After....

HTTP/1.1 200 OK
Date: Tue, 18 Apr 2006 01:43:15 GMT
Server: Apache/1.3.33 (Unix)
X-Powered-By: PHP/4.4.2
Connection: close
Content-Type: text/html

Asia_Expat

2:48 am on Apr 18, 2006 (gmt 0)

10+ Year Member



Also, I just realised that I recall reading that you shouldn't use HTML address in the include. Is that correct? Should I use the following method instead of the one in the original post?...

<?php require("/homepages/24/d143989976/htdocs/forum/footer.html");?>