enter image description here

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
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • What does "not insert" mean? you can keep forgetting, therefore it is not inserted - BOPOH
  • No, I saved)) - T.Lazarchuk
  • saved, but not uploaded to the server, or uploaded, but not to the one on which you are looking, or to that, not another file. I asked a clear question - what does “not insert” mean? I have already come up with three reasons for not introducing, I can come up with a thousand more, but they will not help you unless I and others know what exactly is wrong with you. Wangoo, that now you just have a web server not configured ( AddType application/x-httpd-php .php .htm .html ) - BOPOH
  • @RAVON web server is not configured, but for some reason .php works .html does not work. - T.Lazarchuk
  • one
    Paste the code as a code. A picture with a code is not considered a code. - PashaPash

2 answers 2

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