Monkuar Posted May 24, 2009 Share Posted May 24, 2009 // Load and Start IPB SDK require_once "/forums/ipbsdk/ipbsdk_class.inc.php"; $SDK =& new IPBSDK(); Ok im editing this: but im putting that inside a directory that's http://talkalot.info/phpfreechat/demo/demo55_mysql_container.php how do i require require_once "/forums/ipbsdk/ipbsdk_class.inc.php"; if im in a different folder directory? Omg this is hard to explain but yea.. xD dont i have to use like /....//forums/ipbsdk/ipbsdk_class.inc.php something like that?to make it go back directorys Quote Link to comment https://forums.phpfreaks.com/topic/159494-solved-php-require-directory-help/ Share on other sites More sharing options...
ToonMariner Posted May 24, 2009 Share Posted May 24, 2009 i always reference includes absolutely so $_SERVER['DOCUMENT_ROOT'] . 'path/to/file.ext' 9obvioulsy check if $_SERVER['DOCUMENT_ROOT'] has the trailing forward slash - if not you'd need '/path...'. In doing so - should you need to move/copy then its straight forward. As you are including a class file - why are you not using the __autoload function? Quote Link to comment https://forums.phpfreaks.com/topic/159494-solved-php-require-directory-help/#findComment-841329 Share on other sites More sharing options...
Monkuar Posted May 24, 2009 Author Share Posted May 24, 2009 i always reference includes absolutely so $_SERVER['DOCUMENT_ROOT'] . 'path/to/file.ext' 9obvioulsy check if $_SERVER['DOCUMENT_ROOT'] has the trailing forward slash - if not you'd need '/path...'. In doing so - should you need to move/copy then its straight forward. As you are including a class file - why are you not using the __autoload function? Script is from 2002. lol Im so lost on what u said could u explain it a little bit more, thanks sir something like this? require_once '$_SERVER['DOCUMENT_ROOT'] . '/forums/ipbsdk/ipbsdk_class.inc.php"; i get error.. ;p Quote Link to comment https://forums.phpfreaks.com/topic/159494-solved-php-require-directory-help/#findComment-841331 Share on other sites More sharing options...
ToonMariner Posted May 24, 2009 Share Posted May 24, 2009 require_once($_SERVER['DOCUMENT_ROOT'] . '/forums/ipbsdk/ipbsdk_class.inc.php'); Quote Link to comment https://forums.phpfreaks.com/topic/159494-solved-php-require-directory-help/#findComment-841332 Share on other sites More sharing options...
Monkuar Posted May 24, 2009 Author Share Posted May 24, 2009 thx u sir resolved. Quote Link to comment https://forums.phpfreaks.com/topic/159494-solved-php-require-directory-help/#findComment-841335 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.