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

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.