I have some problem on my work. I have PHP file and want to include his file to HTML page. I used include_once()..
I just want to know, why can't include_once() run on my HTML page?
Thank you...
include_once is a php command and it cannot be run with HTML.
The file extension of your page must end in .php so that your server knows to read the instructions with the php processor, OR you have to have some directives written into your .htaccess file to allow the server to do some fancy work.
Save your file as .php and include the file like this.
<h1>My HTML</h1>
<?php include_once ('myFile.php') /?>
<p>More Html</p>
PHP can parse the HTML!
.htm/.html? Well those simply do not get parsed as PHP in default configuration..htmlor.htmfile extension? Have you got the path to the include correct? Without your code and a clearer understanding of the problem we cannot help.htmlor.htmto be executed like.phpfiles are then you cannot include php files as you are trying.