(This has amost certinaly been anwsered before, but I can't find it here...) I've been banging my head against the wall for far to long now, this should not be as complicated as I seem to find it...
File structure: .
./v1
./v2
./v2/index.php
./v2/Conn/dbopen.php
./v2/inc/functions/logit.php
./v2/inc/function/special_function/dosomething.php
I need to find some way of including "./v2/Conn/dbopen.php"
from "where ever".
If, in "logit.php"
, I enter: require "../../Conn/dbopen.php";
that won't work when I call logit()
from logit.php in dosomething.php since then the path won't be right.
I'm not allowed to include it with the full URL (http*://www.example.com/v2/Conn/dbopen.php
).
To make it a bit more complex (?), it needs to work for serveral server with different folder structure.
http://localhost/site/, https://www.test.example.com/, https://www.example.com
I've tried with all sorts of solutions I can come up with.
$_SERVER-variables
, full URL-includes and all other ways I can think of.