A
A
Alexandr202017-01-24 10:51:56
PHP
Alexandr20, 2017-01-24 10:51:56

Php code in html document closed by comment tags?

Good day everyone!
There is an index.html file on the shared hosting, .htaccess is at the root, .php files work fine, but when you try to insert a simple php code <?php echo '1111'; ?> in the html document there is a problem:
1) if .htaccess says:
RemoveHandler .html
AddType application/x-httpd-php .php .html
then the file is loaded on the screw when opened in the browser
2) if .htaccess says:
RemoveHandler . html
AddHandler application/x-httpd-php .php .html
the page opens in the browser but the php code is closed by comment tags
Has anyone encountered this problem?
PS it is important to insert php into html and not change the file extension to php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Bay, 2017-01-24
@kawabanga

P.S. важно именно сделать вставку php в html а не поменять расширение файла на php
Вам важно открывать в браузере файл как html.
Переименуйте файл в .php .
Через .htaccess сделайте замену окончания .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question