Problem including a file
I am a PHP newbie, but learning quickly.
I use include to display the header and footer for my website.
The name of the header file is header.inc
In my index.php file, I have
But it will not display, instead I get an error message saying there is no file called headerinc. Thats right, it is removing the period inbetween header and inc.
What would cause this?
The only way I can make includes work, is to name the file with no extension.
I renamed it to just header, and it works file when I tell it to include header, but if I give it a name with an extension, it will not work.
Place quotation marks around the file name. Such as:
That fixed it, but why would not having the " marks around it cause apache to rewrite the filename without the period?
You can also use
because otherwise php is treating the . as a concactanation operator and simply combines the two strings on either side of it
Ah, I understand now.
Originally Posted by jinkas
Thanks guys, for the speedy response.