I have a few files in my root directory. db.php and settings.php.
I have another file called, calculate_value.php in my root directory. This has a function in it that calls the db.php.
I then have a normal page, that calls calculate_value.php page and uses the function and displays the results to a user. All good.
The issue is, I'm now wanting to use the calculate_value.php from another folder mysite.com/members/my-page.php. When I call the calculate_value.php page, the db.php reference inside the function does not find the page as it's looking in the current folder. If i do require '../db.php'; it would work I assume but then in the root directory it wont.
How can I fix this?