system — 2010-10-21T06:03:13-04:00 — #1
how to write php script in index.html
Example: If we write <?php echo "Hello";?> in index.php the output is "Hello", if we write <?php echo "Hello";?> in index.html what will be the out put?
and is it possible to execute the php script in extension of html (ie. index.html)
Web Development Services
elgumbo — 2010-10-21T06:24:28-04:00 — #2
Hi, you can tell your server to treat a html file as a php file in the .htaccess file.
Add this to your site's .htaccess file
AddType application/x-httpd-php .html .htm
Try your echo statement again in the index.html file to check it's working.
More info here: http://www.besthostratings.com/articles/php-in-html-files.html