0

I have been trying to work around a problem but am not having much luck.
I have classes that include a file with my db settings. The problem is I have a functions directory that calls some of the classes. I get failed to open stream: No such file or directory. Is there a way to include this file no matter where the class is being called from?

Thank you

2
Contributors
2
Replies
11
Views
3 Years
Discussion Span
Last Post by Bob Hensley
0

I found it.
include($_SERVER["DOCUMENT_ROOT"]."/filepath";

I'd just like to point out that there's a syntax error here: you omitted the terminating parenthesis. I would also recommend, if this file is critical to your application, you use the require_once() function instead.

Edited by Bob Hensley

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.