Re: .html or.php extension
| From: | Chris Garaffa | Date: | Sun, 08 Feb 2004 17:19:57 +0000 |
| Subject: | Re: .html or.php extension | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-177150@lists.php.net to get a copy of this message | ||
On Feb 5, 2004, at 5:15 PM, E.H.Terwiel wrote:
My PHP system demands that files to be interpreted by PHP MUST have the .php extension. If I have an .html file with <?php ....?> in it, it won't interpret the PHP code. Unlike JavaScript, f.i. Right, the browser interprets the JavaScript that's sent to it; the server has to process the PHP before sending it to the client.
Is there a way to make the server do the PHP code anyway, in an HTML file ? Or must the action yes-php/no-php be taken before looking into the file ? You're spot on here. You can have your web server process other files as PHP. Check the documentation for your web server to figure it out.
The other way around is ok: put HTML code in a .php file... Yep, that's fine. PHP ignores anything that's not in <? ?> and just outputs it to the browser.HTH, -- Chris Garaffa chris@nilzero.com