About include path issues
, the wording of my action.php quote: include ' class/users.php ';
The wording of my uploadpic.php quote: ". /class/users.php ";
My users.php refers to the connection database: include '. /admin/class/connect.php ';
The problem is users.php reference connection database, if so, action.php will prompt the connection database failed, but uploadpic.php normal!
If written as include ' admin/class/connect.php ', that action.php normal, but uploadpic.php will prompt to connect to the database failed!
Is the problem of the path, uploadpic.php to return to the upper level to refer to, action.php do not need.
Find a solution!!!
------Solution--------------------
In your program's root file definition
Define ("Root_dir", DirName (__file__));
For example, your action.php joins the definition above
Include Root_dir. '/class/users.php ';
Include Root_dir. '/admin/class/connect.php ';
------Solution--------------------
The principles of include are:
Always a top-down quote
References in all referenced files are relative paths to relative portal files