On Fri, Jan 9, 2009 at 12:47 PM, Jason Pruim <japr...@raoset.com> wrote:
>
> On Jan 9, 2009, at 12:18 PM, Gary wrote:
>
>> Can I create a page with the php extension that contains only contains
>> html
>> and no php?  If so are there advantages/disadvantages?
>
> Yes, Look at heredoc syntax on the php.net site. Works really well for a few
> pages that I use.

You don't need heredoc for a page that doesn't have any PHP code in it.

file: HelloWorld.php
----------------------------------------
<html>
<body>
<p>Hello World</p>
</body>
</html>
----------------------------------------

This is a prefectly valid PHP page.


>> Can I mix and match file formats (php/html) in a single site?
>
> Yes. You can easily mix and match, in fact... if you go one step further...
> You can remove the extension's all together from the files so that you can
> change it as needed and not screw up any links that you have already
> created.

How would you do that? The options I can think of involve:

1) You have to either configure the web server to serve everything
(including images, flash content, javascript, CSS, etc.) through PHP
-- or at least anything without a handled mime-type.

2) You have to configure the web server to use something like
mod_rewrite to point URLs to the correct script.

3) You create a folder for every unique page in the entire site and
each folder contains exactly one file named either index.php or
index.html (or whatever the default document name is for your web
server).

Andrew

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to