fer987 Posted May 26, 2011 Share Posted May 26, 2011 Hi! I am new to PHP and I googled a lot before coming here. I have trouble accessing localhost/community/admin/board_functions.php from a folder which path is localhost/community/boards/test/index.php, which script is the one below. What path should I put on require_once to access the script? Thanks in advance <?php require_once "..admin/board_functions.php"; $board_location = explode("\\", __DIR__); $board_name = $board_location[5]; $board_title = board_title($board_name); echo $board_title; ?> Link to comment https://forums.phpfreaks.com/topic/237561-i-cant-access-configphp-with-include_once/ Share on other sites More sharing options...
xyph Posted May 26, 2011 Share Posted May 26, 2011 You're better off using absolute paths require_once "/full/path/to/community/admin/board_functions.php"; Otherwise, you want require_once "../../admin/board_functions.php"; You need a '../' for each branch you want to go down Link to comment https://forums.phpfreaks.com/topic/237561-i-cant-access-configphp-with-include_once/#findComment-1220738 Share on other sites More sharing options...
fer987 Posted May 26, 2011 Author Share Posted May 26, 2011 Thanks! I didn't know that Link to comment https://forums.phpfreaks.com/topic/237561-i-cant-access-configphp-with-include_once/#findComment-1220739 Share on other sites More sharing options...
xyph Posted May 26, 2011 Share Posted May 26, 2011 No problem, please mark topic as solved! Link to comment https://forums.phpfreaks.com/topic/237561-i-cant-access-configphp-with-include_once/#findComment-1220765 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.