Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML pages with php?

Status
Not open for further replies.

litton1

Technical User
Apr 21, 2005
584
GB
I have a client who has some .html WebPages that are ranked quite well. is it possible to put php into these WebPages without changing the HTML extension into a php one? thanks in advance.

Binary Intelligence, true or false?
 
No, you can't, because then any PHP code in them will not get interpreted by the server as PHP. The extension tells the server what to do with them.

htm,html, display as is
PHP,ASP, execute in server then display.
 
what is the phtml extension?

Binary Intelligence, true or false?
 
ok found the answer (i new that i had seen it somewhere)
instead of
AddType application/x-httpd-php .php
you have
AddType application/x-httpd-php .php .html
according to this page

Binary Intelligence, true or false?
 
Of course you realize that it is going to parse every html file in there even if it does not have any PHP code. this might cause some delay issues or lag, when you are dealing with very large informative html pages. Since it will have to go through them. But any way it should still work.
 
yes true but is this not what would happen amyway?

Binary Intelligence, true or false?
 
There is no problem with that, litton1.
No matter what, it's already working like that anyway.
The parser will only process the PHP if there are codes in this tag:
<?
?>

So, what you need to be aware of is to make sure there is no such tag in your HTML file, or it will return error.

Good luck.
 
I see, as always thanks for your time help and advice guys.

Binary Intelligence, true or false?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top