thewooleymammoth Posted March 6, 2009 Share Posted March 6, 2009 this code produces this error <?php /*******************uncomment to add**************/ require($_SERVER['document_root'].'/lib/lib.inc'); require($_SERVER['document_root'].'/lib/bannergen.inc'); /************************************************/ echo <<<HTML <html> <head> <title>Banner Demo</title> <link rel='stylesheet' type='text/css' href='style.css'> </head> <body id='body'> HTML; getpics(); echo <<<HTML </body> </html> HTML; ?> Warning: require_once(/lib/bannergen.inc) [function.require-once]: failed to open stream: No such file or directory in /var/www/offline/banners/index.php on line 4 Fatal error: require_once() [function.require]: Failed opening required '/lib/bannergen.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/offline/banners/index.php on line 4 and i cant figure out why it errors on the second but not the first, the name of both files are correct. and i can acess both of them Link to comment https://forums.phpfreaks.com/topic/148185-solved-second-require_once-does-not-work/ Share on other sites More sharing options...
corbin Posted March 6, 2009 Share Posted March 6, 2009 $_SERVER['document_root'] Should be $_SERVER['DOCUMENT_ROOT'] Link to comment https://forums.phpfreaks.com/topic/148185-solved-second-require_once-does-not-work/#findComment-777856 Share on other sites More sharing options...
thewooleymammoth Posted March 6, 2009 Author Share Posted March 6, 2009 oooh ok thanks, any insight as to why it works for one but not the second one? Link to comment https://forums.phpfreaks.com/topic/148185-solved-second-require_once-does-not-work/#findComment-777868 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.