The php script is not inserted into the html file. And so php works if the extension is .php
Closed due to the fact that off-topic participants Nick Volynkin ♦ , cyadvert , Cerbo , Bald , user194374 Nov 30 '15 at 6:55 .
It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:
- “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - Nick Volynkin, cyadvert, Cerbo, Bald, Community Spirit
2 answers
by default php in html file is not executed, how to configure read
It is necessary to add such line to the .htaccess file or to the Apache config
# Разрешаем исполнять php в .htm и .html файлах AddType application/x-httpd-php .htm .html After that, php will be executed in html files, which will lead to a loss of performance, since all HTML files will be processed as PHP code. Therefore, place php code in .php templates.
And change the html tag in the last line of your code to the closing one.
- remove the link and what will be the use of your question? the answer must be answered, and the link is an additional source - BOPOH
- @BOPOH "the answer should be in the answer" - strongly said, "remove the link" - why should I remove the link to the solution of the question? - vadim-kot
- @ vadim-kot references to SO are not welcome because of the possibility of the source disappearing or temporarily souring after some time. - etki
- one@BOPOH what is SO? - vadim-kot
- stack overflow. - etki
You have incorrectly closed the html tag, it must be </html>
The final settings are for the html extension to perform php functions - because you need to send a file to the server to replace php-inserts with html constructs.
- fixed on </ html> still not working - T.Lazarchuk

AddType application/x-httpd-php .php .htm .html) - BOPOH