Embedding HTML within .PHP files is one of the primary functionalities of PHP, but is it possible to do it the other way round?
I mean, embedding PHP t开发者_Python百科ags, , within a .HTML document?? Is this sort of coding possible?
Any suggestions welcome.
Add this to your .htaccess file and HTML files will be handled like PHP files allowing you put PHP in HTML files.
AddType application/x-httpd-php .html
Some more information on it here
If you configure your server properly you can put php code in almost any kind of file.
If you are using apache, just add this line in the httpd.conf file
"AddType application/x-httpd-php .html"
Now you can embed php tags in .html files and they will be parsed correctly
精彩评论