-1

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?

Peter Mortensen
  • 28,342
  • 21
  • 95
  • 123
user939687
  • 45
  • 7
  • 2
    The `.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 Answers1

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
  • 28,342
  • 21
  • 95
  • 123
Peter Pei Guo
  • 7,536
  • 17
  • 32
  • 51