The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End PHP Include problem

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #46111


    I’m 99.5% new to PHP, but I’ve done some coding in other languages. I inherited this website and it has a few HTML files in it with some form of include syntax that includes a .php file into the page.

    Since the file (home.html) has an .html extension I’m confused on how it is able to include a php file within it with the code below?

    Can someone why this code possibly works or if there was something special needed to get an html file to include some php file?

    I copied the code over to my machine and it when I run it, it doesn’t process the header.php file unless I rename the HTML file to home.php, but the site seems to work fine where the code previously was if that makes sense.


    I’m 99% sure this is an .htaccess thing that allows different file extensions to handle PHP functions. Somebody else can certainly speak a little more clearly on the topic, I’m far from an .htaccess expert!


    Apache is treating all `.html` requests as `.php` request. And is able to process the PHP code. @TheDoc is right, 99% chance it’s .htaccess file.


    Ok, thanks…

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Back End’ is closed to new topics and replies.