I understand that the .php file extension is necessary for PHP parsing, but is it possible to work around this by putting the PHP code in a separate file and then using a .html file that includes it in a script tag?
Asked
Active
Viewed 120 times
-1
-
2The `.php` extension is not necessary. You can use an `.htaccess` to put additional rules, [as such](http://stackoverflow.com/a/6237056). – Dave Chen Sep 07 '14 at 04:54
-
`AddType application/x-httpd-php .html` in an `.htaccess` file will enable your html files to be parsed for PHP scripts as well – Hanky Panky Sep 07 '14 at 05:04
1 Answers
2
You can name a PHP script a.blah, which still runs:
php a.blah
As long as a.blah contains a valid PHP script.
Peter Mortensen
- 30,030
- 21
- 100
- 124
Peter Pei Guo
- 7,612
- 17
- 33
- 53