I am using include function and it is giving errors. That is file not found. In the root directory I have - index.php and config.php
index.php includes config.php and has some other data.
config.php has database details and includes function/function.php
There is a folder user and it has a file calculate.php in calculate.php I have included AJAX functionality and a file is loaded in it on AJAX call. File is cal2.php and it is located in user folder. Now this, cal2.php has a include function for config.php like:
include "../config.php";
When this cal2.php is loaded from calculate.php
function/function.php file is not loaded. It shows file not found for function/function.php
So, file structure is:
- root
- /index.php
- /config.php
- /user/calculate.php
- /user/cal2.php
- /function/function.php
How to proceed and not have function.php include error for cal2.php