justlukeyou Posted March 13, 2011 Share Posted March 13, 2011 Hi, I have a script which uses a connect file but I am struggling to get files in other folders to read and for the "$loggedIn = checkLogin();" code to work. If I connect to the database within the same script it works straight away. If I change my password then I have to change every file but otherwise I cannot include the connect file as I have to link to it locally. So if the connect file is in: www.domain.co.uk/php/login/connect.php then www.domain.co.uk/php/login/index.php -- this works www.domain.co.uk/php/logout.php -- this doesn't regardless of how I link to the connect file. Link to comment https://forums.phpfreaks.com/topic/230518-using-connect-files/ Share on other sites More sharing options...
cunoodle2 Posted March 13, 2011 Share Posted March 13, 2011 In the file "login/index.php" I assume you have the code of.. require_once "connect.php"; In the file of "logout.php" you would need to alter the path to say.. require_once "login/connect.php"; Does this work? If not then post some code and I'll take another look. Link to comment https://forums.phpfreaks.com/topic/230518-using-connect-files/#findComment-1187021 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.