Web page will not parse PHP code

I am trying to add part of my own PHP to an almost unreadable template file in a forum system. I know that everything works fine, like server configuration, etc., but PHP just doesn't parse this page. JS works great. Any ideas? This is a simple .html page.

+3
source share
4 answers

Try adding this to your .htaccess (or create a new one in the appropriate directory):

AddType application/x-httpd-php .php .html
+4
source

Is it possible that the template file is read into a variable and not included or required? For instance. is it loaded using file_get_contents or something similar?

, eval() , file_get_contents PHP-, , . , . , , , .

+3

Many template systems use their own encoding syntax. If so, it will not be possible to add PHP code to your template without opening many security holes.

Try to study the template language used or find out where you should place the code without changing the template file (a controller or plug-in system can be created for such material).

+2
source

Your page should be a .php page.

0
source

Source: https://habr.com/ru/post/1777607/


All Articles