PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I never said relative path didn't work. I just said I want absolute path to work for php files and it already works for images and css. It seems like the problem is with the function include/require/require_once.
I'm getting the impression from people that includes a somehow relative to the document root.
Remember this is not the case. They are relative to the location of the script being executed, the two aren't necessarily the same.
That's why I always set a var to my document root and use that var. Not dependence on $_SERVER vars or trying to figure anything out programmatically. Just tell the script where everything starts. Then use that as the starting point.