I'm struggling slightly to understand your question. I think your file structure looks like this:
If so, to include db.php
from main.php
, all you need do is include('db.php');
. The current folder is automatically in the path used to determine which files might be included.
In auth.php
, you do include('../test/main.php');
. This is unnecessary, since you are already in the test
folder. You do ..
to get out of it, then you go straight back into it! You can simplify this with include('main.php');
.