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...
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!