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; ?> Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
fer987 Posted May 26, 2011 Author Share Posted May 26, 2011 Thanks! I didn't know that Quote Link to comment Share on other sites More sharing options...
xyph Posted May 26, 2011 Share Posted May 26, 2011 No problem, please mark topic as solved! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.