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?
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?
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.
index.php - HerrgottDepends 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 php function marked as <- <? php ....?> -> - 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" ? - ReinRausSource: https://ru.stackoverflow.com/questions/517995/
All Articles