Reza Fahmi Reza Fahmi - 10 months ago 29
HTML Question

display php result in html page

how to display php result in html file?
this is my index.html file

<title>My PHP Page</title>
This is HTML code
Back into HTML

and i want to display the blabla.php result in index.html
but the result when i execute the index.html is

This is normal HTML code Back into normal HTML

thanks before :)


You can't run PHP in .html files because the server does not recognize that as a valid PHP extension unless you tell it to. To do this you need to create a .htaccess file in your root web directory and add this line to it:

AddType application/x-httpd-php .htm .html

This will tell Apache to process files with a .htm or .html file extension as PHP files. for more info please read this