My file "login/index.php" begins with this code: <html><head><title>Login Test</title></head> <body> <?php require_once("../functions/functions_db.php"); db_connect(); Code (markup): The directory "functions" is on the same level as "login", so I'm telling the script to look up into the root directory from "login", then back down into "functions" to grab the required file. However, I get this error message: Suffice to say, "db_connect()" is a function in the required file, so does anyone know what I'm doing wrong?
Well of course it is saying it cannot find that function, now are you 100% sure that the function has been named right? And your linking it is 100% correct?
^ The path must be correct, because require_once() would trigger a fatal error an exit the script before it gets to the part where it calls the function. It's probably a silly error, like a spelling mistake in one of the functions or something.
Either that or the functions are in a class..? I know with my DB file, I have it in a DB class (which means I'd have to call the functions with $DB->query and such).
It was indeed silly. Phenomenally silly, ludicrously silly. The included file was missing the question mark from the opening <?php line. I hang my head in shame...