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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.