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 117 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.
![](../../users/profiles/63550.webp)
Peter Mortensen
- 28,342
- 21
- 95
- 123
![](../../users/profiles/2419183.webp)
Peter Pei Guo
- 7,536
- 17
- 32
- 51