Strange include problem

Hi guys. This problem has been driving me crazy for sometime now.

I would appreciate any help.

I have two files, index.php and test.php. If they are both in the same directory and I include test.php into my index.php file I can use variables declared in index.php in my test.php file. But if I move test.php into a subdirectory, I get Undefined variable errors. Again if anyone can help I would really appreciate it.

Well, undefined variable errors are usually because the variable hasn`t been declared before its being used. Try and use the isset() function, or for quickness, just set your error reporting to 0.

error_reporting(0);

You might also want to varify that you areactually connecting to the included file.

Sponsor our Newsletter | Privacy Policy | Terms of Service