开发者

PHP HTML Embed PHP Tags within a .HTML Document Is This Possible?

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜