how do i run a function declared in another php file without using “include” or “require”?
for example (below) file1.php contains function connectToDB()
which accesses db.conf file to get connection details for my database, then connects to the database. the problem is that if i need to use the function connectToDB()
in file2.php, i cannot use “include(’…/file1.php’)” or “require…”, because it will try to find folder1.2>folder1.1>db.conf instead of folder1.1>db.conf.
b[/b]
-file1.php
-b[/b]
–db.conf
-b[/b]
–file2.php
so i can’t use “include” or “require”. what do you suggest? thanks
or i can rephrase my question to “how do i run connectToDB() (declared in file1.php) in file2.php as if it was run from file1.php?”
help???