can i run php inside a .html file?

S

Stefan B Rusynko

No
The server needs to know to process it server side w/ the PHP engine so it needs a .php extension




| Please I need to know how can I run php inside a .html file?
| Thanks
|
|
 
M

Murray

Or your server needs to be set to parse all files, right?

Wouldn't a page with the proper language declaration execute then?
 
S

Stefan B Rusynko

Don't do PHP so don't know
- but it would be a waste of server time for pages w/ no server side code to process

I wouldn't even know how to set the ASP engine to parse .htm files
- I guess in IIS you could add .htm to the ISAPI application mappings for the asp.dll

Somewhere in the PHP engine there must be as similar mapping




| Or your server needs to be set to parse all files, right?
|
| Wouldn't a page with the proper language declaration execute then?
|
| --
| Murray
| ============
|
| | > No
| > The server needs to know to process it server side w/ the PHP engine so it
| > needs a .php extension
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.net-sites.com/sitebuilder/newsgroups.asp
| > _____________________________________________
| >
| >
| > | > | Please I need to know how can I run php inside a .html file?
| > | Thanks
| > |
| > |
| >
| >
|
|
 
T

Thomas A. Rowe

But if you map .htm(l) to the PHP engine, then all pages in the site will be process first by the
PHP engine, and unless the PHP engine is design like the ASP engine, you will be wasting processor
time.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================
 
M

Murray

This is a tiny waste, however, unless your pages are massively long.

--
Murray
============

Thomas A. Rowe said:
But if you map .htm(l) to the PHP engine, then all pages in the site will
be process first by the PHP engine, and unless the PHP engine is design
like the ASP engine, you will be wasting processor time.

--
==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
==============================================
If you feel your current issue is a results of installing
a Service Pack or security update, please contact
Microsoft Product Support Services:
http://support.microsoft.com
If the problem can be shown to have been caused by a
security update, then there is usually no charge for the call.
==============================================

Stefan B Rusynko said:
Don't do PHP so don't know
- but it would be a waste of server time for pages w/ no server side code
to process

I wouldn't even know how to set the ASP engine to parse .htm files
- I guess in IIS you could add .htm to the ISAPI application mappings for
the asp.dll

Somewhere in the PHP engine there must be as similar mapping




| Or your server needs to be set to parse all files, right?
|
| Wouldn't a page with the proper language declaration execute then?
|
| --
| Murray
| ============
|
| | > No
| > The server needs to know to process it server side w/ the PHP engine
so it
| > needs a .php extension
| >
| > --
| >
| > _____________________________________________
| > SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| > "Warning - Using the F1 Key will not break anything!" (-;
| > To find the best Newsgroup for FrontPage support see:
| > http://www.net-sites.com/sitebuilder/newsgroups.asp
| > _____________________________________________
| >
| >
| > | > | Please I need to know how can I run php inside a .html file?
| > | Thanks
| > |
| > |
| >
| >
|
|
 
T

Terry Stockdale

Please I need to know how can I run php inside a .html file?
Thanks

From a practical point of view, no you can not do that. You can embed
PHP code in a file that has HTML code, but the server has to be told
to always pass a file with that extension through its PHP code
processor.

In other words, IF you have control of the server, you could make it
run ALL .html files through the PHP code processor, just in case there
was real PHP code in the file.

If you are hosting with a third-part web host, you are not likely to
have that level of control. And, no, they are not going to agree to
do that for you, as it would affect EVERYONE's .html files on their
servers -- adding a significant load to their shared-hosting servers.

Bottom line: If you have your own server, dedicated server or virtual
server, the you can do it. With shared hosting, no.
 
Top