aizul Posted October 7, 2013 Report Share Posted October 7, 2013 Понедельник день тяжелый... или лыжи не едут))1. Создал страницу index.html2. создал страницу menu.html3. прописал в .htaccess:AddType application/x-httpd-php .php .php3 .php4 .phtml .html4. в index.html прописал <?php require_once("menu.html")?>Результата нет, содержимое menu.html не отображается(Я уже и расширения у файлов менял, и функцию include использовал, и в .htaccess разный код прописывал...В исходном коде выводится так:<!--?php require_once("menu.html")?--> Quote Link to comment Share on other sites More sharing options...
0 wwt Posted October 7, 2013 Report Share Posted October 7, 2013 php вообще установлен на сервере? Quote Link to comment Share on other sites More sharing options...
0 aizul Posted October 8, 2013 Author Report Share Posted October 8, 2013 On 10/7/2013 at 12:51 PM, wwt said: php вообще установлен на сервере?Установлен. Quote Link to comment Share on other sites More sharing options...
0 wwt Posted October 8, 2013 Report Share Posted October 8, 2013 Проверьте в файле конфигурации Apache наличие примерно вот таких строчек:LoadModule php5_module /usr/lib/apache2/modules/libphp5.so<IfModule mod_php5.c> AddType application/x-httpd-php .php .phtml .php3 AddType application/x-httpd-php-source .phps</IfModule>Пути могут отличатся. Quote Link to comment Share on other sites More sharing options...
0 CoDy Posted October 8, 2013 Report Share Posted October 8, 2013 Если это не на хостинге, а сам поднимаешь Apache + php, - тогда выложи конфиги апача и пхп.Если это у хостера, тогда в поддержку. А вообще очень похоже, что коды включения пхп скрипта спецом экранированы. Быть может, на хостинге не разрешается включение пхп в html-файлы(например в целях безопасности). Quote Link to comment Share on other sites More sharing options...
0 Int Posted October 11, 2013 Report Share Posted October 11, 2013 On 10/8/2013 at 9:07 AM, CoDy said: Быть может, на хостинге не разрешается включение пхп в html-файлы(например в целях безопасности).экранируется, видимо, только вывод работы php, а сам-то он выполнится, потому что найдёт свои тэги. Quote Link to comment Share on other sites More sharing options...
Question
aizul
Понедельник день тяжелый... или лыжи не едут))
1. Создал страницу index.html
2. создал страницу menu.html
3. прописал в .htaccess:
4. в index.html прописал <?php require_once("menu.html")?>
Результата нет, содержимое menu.html не отображается(
Я уже и расширения у файлов менял, и функцию include использовал, и в .htaccess разный код прописывал...
В исходном коде выводится так:<!--?php require_once("menu.html")?-->
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.