+ 6
[Solved] IS IT POSSIBLE TO USE PHP CODE IN .HTML FILE?
If I use html in .php file it will work just fine but if I use php code in .html file it's not working. We can use include('file.php') command but for that too we have to make .php file to use that because it's a php command, so basically my question is can we use .php code in .html?
3 Respostas
+ 1
it is possible if you configure the server to process php in .HTML files rather than serve them as static files.
+ 3
you can send ajax requests to php scripts from your html page and use the server response to dynamycally manipulate the dom
+ 2
You cannot use php in .html files. The .html files are most likely to be generated by php templates system, which is implemented via programmers or they are already built in framework if you are using one.