I bought a host for $ 0.5. PHP supports.
Does not work include
In the index.html in the body tag indicated

 <?php include('php/test.php'); ?> 

in test.php

 <p>Testing string</p> 

Why is the message not displayed?

    2 answers 2

    It is necessary to register not a relative path to the subfolder, but an absolute path. And not from the root of the site, but from the root of the hosting. On Masterhost, it looks like this:

     include_once '/home/uXXXXX/mysite.ru/www/php/test.php'; 

    Update from Reply Comments

    • If index.html in rename index.php, what will show?

    • It worked. And why?

    • HTML is the page markup, and PHP is the script. Therefore, php-files are able to include each other, and for an html-page the php-line with the inclination is an empty sound. It is repaired either by strict observance of the extension, or by setting up the server. I advised to change the extension, and it helped. Neighbor advised to change the settings so that the html-pages are processed as php-scripts. Why his advice did not help, we must understand. The advice is also correct.

    • does not work .... - Herrgott
    • one
      @Herrgott test.php in itself that shows? If index.html in rename index.php, what will show? - Gleb Kemarsky
    • Here, now it works, thanks. And why? - Herrgott
    • @Herrgott I'm a little confused in two parallel dialogues .... What did you do in the end? After what earned? - Gleb Kemarsky
    • after renaming to index.php - Herrgott

    Depends on the web server settings. As far as I understand, your web server ignores php-code, which is inserted into the html-code and displays it as plain text.

    Try to create a file with the name: .htaccess And add the following line to it:

     AddHandler application/x-httpd-php .php .html .shtml .htm 
    • He does not deduce anything at all. Just a clean page - Herrgott
    • The source code of the page looked? - Yukio
    • looked through dragonfly opera, php function marked as <- <? php ....?> -> - Herrgott
    • Added, does not work - Herrgott
    • Он вообще ничего не выводит. Просто чистая страница Он вообще ничего не выводит. Просто чистая страница How did you then determine that it was the inclusion that did not work? What will happen if instead of includ make echo "test" ? - ReinRaus