| 10:40 pm on Dec 7, 2013 (gmt 0)|
If your header.inc.php file is located inside the /includes/ folder of the newdesign directory as shown, it is not in directory you are trying to use it in. The simplest solution is to create a copy of the /includes/ folder in the /forms/ directory and then it could conceivably use the path you are using.
| 10:41 pm on Dec 7, 2013 (gmt 0)|
Dang it, I was about to post a question with the identical subject line and now I'll have to think of something else.
Is the ultimate document --the one that the user sees-- html or php? Does the include file have parameters? Does anything behave differently if you step out of php and configure the include as an SSI instead? I throw out these questions because they played a role in my own (unrelated) problem.
|it is not in directory you are trying to use it in |
Isn't that what $_SERVER['DOCUMENT_ROOT'] is for?
| 10:59 pm on Dec 7, 2013 (gmt 0)|
|Isn't that what $_SERVER['DOCUMENT_ROOT'] is for? |
Actually that part is not needed, but the folder has to be on the same directory level, the same path. Things I learned the hard way. I don't know anything about php except using includes, but generally the server can't process the request and a look at error logs with give you a message about headers already sent.
| 11:55 pm on Dec 7, 2013 (gmt 0)|
|the folder has to be on the same directory level, the same path |
That can't be right. If it were, then the line
include ($_SERVER['DOCUMENT_ROOT'] . "/includes/fullfooter.html");
would never work, because it only occurs in files that are not, themselves, in the /includes/ directory.
| 12:19 am on Dec 8, 2013 (gmt 0)|
Thanks Lucy24 and not2easy for your input on this.
@not2easy, the header.inc.php file is inside the include directory under the root. It works for all files under the root directory, but does not for files within sub directories under the root (in my case root -> forms).
@lucy24, addressing your questions, the ultimate document is a php file (.php) which includes the header file. The biggest issue I have is that the header file has the link to the css and that is throwing the entire page out of sync.
@not2easy, your solution would work at this time, but the issue still remains unresolved - why and how to get his working having the include in just one place under the include folder; replicating it in every subfolder would not be and ideal solution.
| 3:21 pm on Dec 9, 2013 (gmt 0)|
This should work. In so far as "header.inc.php" should be included from any document. What exactly "fails to work"?
(The whole point of $_SERVER['DOCUMENT_ROOT'] is that it makes it an absolute path, accessible from anywhere.)
|The simplest solution is to create a copy of the /includes/ folder in the /forms/ directory... |
What?! That defeats the whole purpose of having an "includes" folder in the first place!
Agreed. It's not right!