TheFilmGod Posted July 28, 2009 Share Posted July 28, 2009 This has got to be a php bug! This is really weird. I require() a file which has numerous functions in it that I call within the main php file later on. AS such: <?php // Require page directory handler require ('page_builder.php'); // Define unique page elements $page['name'] = 'login'; ?> <html> ... html crap ... <? build_toolbar(); // defined in page_builder.php file that was required earlier ?> ... html crap .. </html> Very simple. Works like a charm when the required file is in the same directory as the main file. But when i move the required file into its own directory (away from the main file), php pukes out: "Call to undefined function "build_toolbar();" For some reason php is not registering my functions when I put the required file deep into some directory. This is a problem, because I'm using the require function for a reason... aRG! This doesn't make sense. Link to comment https://forums.phpfreaks.com/topic/167745-solved-what-the-f/ Share on other sites More sharing options...
mmarif4u Posted July 28, 2009 Share Posted July 28, 2009 Did you tried the relative path? Link to comment https://forums.phpfreaks.com/topic/167745-solved-what-the-f/#findComment-884576 Share on other sites More sharing options...
.josh Posted July 28, 2009 Share Posted July 28, 2009 did you try changing your path/to/file in your script? Link to comment https://forums.phpfreaks.com/topic/167745-solved-what-the-f/#findComment-884579 Share on other sites More sharing options...
TheFilmGod Posted July 28, 2009 Author Share Posted July 28, 2009 For some reasons it works now. I don't know what to say.. this php stuff is crazy. It works/doesn't work whenever it feels like. I'll investigate tomorrow. Off to bed now. Link to comment https://forums.phpfreaks.com/topic/167745-solved-what-the-f/#findComment-884580 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.