Jump to content

File Locations


magnified

Recommended Posts

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

 

 

 

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/197106-file-locations/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.