magnified Posted March 31, 2010 Share Posted March 31, 2010 Hi there - I'm relatively new to PHP and Web Development, and I'm hoping you can help me out. On our server, we have two sites: http://support.mysite.com http://www.mysite.com Hosted on IIS, each of these sites have separate folders on the Server Machine: http://support.mysite.com = C:\\Inetpub\\vhosts\\mysite.com\\subdomains\\support\\httpdocs http://www.mysite.com = C:\\Inetpub\\vhosts\\mysite.com\\httpdocs In http://support.mysite.com/includes has about 10 php files with my common functions etc. What's the best/easiest way to use these same 10 files on the primary site? At the top of every page that uses these files on the support side, I have a single line: require_once("./includes/initialize.php"); Inside initialize.php, I further include all the other files I need: require_once($CONFIG['DOC_ROOT_SUPPORT'] . DS . 'includes' . DS .'session.php'); require_once($CONFIG['DOC_ROOT_SUPPORT'] . DS . 'includes' . DS .'database.php'); require_once($CONFIG['DOC_ROOT_SUPPORT'] . DS . 'includes' . DS .'page.php'); require_once($CONFIG['DOC_ROOT_SUPPORT'] . DS . 'includes' . DS ."phpMailer".DS."class.phpmailer.php"); require_once($CONFIG['DOC_ROOT_SUPPORT'] . DS . 'includes' . DS ."phpMailer".DS."class.smtp.php"); I currently have a $CONFIG array, which holds various config options, including the FULL FILE PATH to both of the sites... Is there an easier, better way to do this? Any help would be greatly appreciated. Cheers. Mike 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.