Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder MrBiggZ's Avatar
    Join Date
    Apr 2005
    Location
    Indianapolis IN
    Posts
    337
    Thanks
    44
    Thanked 2 Times in 2 Posts

    include_once with a file from th e primary domain on the subdomain

    Hello!

    From what I've gathered it is not a good thing to call in include file in via URL. Mind you the file I'm including resides on the same server I'm just wishing to include it in a sub-domain. I really don't want to replicate the files cause that makes updating a pain!

    My path in the sub-domain would look like this:

    /html/ftsc.v3/teams/blueflames

    and of course my primary domain path is at:

    /html/ftsc.v3

    I tried doing this

    PHP Code:
    $func file_get_contents(substr($_SERVER['DOCUMENT_ROOT'], 0,(strpos($_SERVER['DOCUMENT_ROOT'],"teams")-1)) . '/scripts/functions.php');
    include_once(
    $func); 
    And it laughed at me!

    If I'm on my own server is it still risk?

    Thanks for any help!
    “No matter how slick the demo is in rehearsal, when you do it in front of a live audience, the probability of a flawless presentation is inversely proportional to the number of people watching, raised to the power of the amount of money involved.” ~ Mark Gibbs

  • #2
    Regular Coder MrBiggZ's Avatar
    Join Date
    Apr 2005
    Location
    Indianapolis IN
    Posts
    337
    Thanks
    44
    Thanked 2 Times in 2 Posts
    Never mind I figured it out!

    I just needed to :

    PHP Code:
    include_once(substr($_SERVER['DOCUMENT_ROOT'], 0,(strpos($_SERVER['DOCUMENT_ROOT'],"teams")-1)) . '/scripts/functions.php'); 
    Could have sworn I did that!
    “No matter how slick the demo is in rehearsal, when you do it in front of a live audience, the probability of a flawless presentation is inversely proportional to the number of people watching, raised to the power of the amount of money involved.” ~ Mark Gibbs


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •