SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Getting files from a different server

    Hello!

    I have a question on php/site management. Basically, I'm going to be developing a site which has "satellite sites" associate with it. In other words, they'll have their own html, but will all follow the same processes as generated by my scripts. If I just do this for a page that's on my own server, then I know that I can use something like:

    PHP Code:
    require_once('../../main_scripts/page_stuff_that_everyone_uses.php'); 
    to grab the required file from my own server. With this in mind, I have two questions.

    1) Can I grab the file from another server assuming that they have PHP installed? For example:

    PHP Code:
    require_once('http://theMainSiteName.com/main_scripts/page_stuff_that_everyone_uses.php'); 
    2) Even if I can do this from another server, would it make more sense to house everything under one domain name with subfolders representing the "satellite sites"?

    Basically, I'm hoping to keep my processes close to home, but let the "satellite sites" fiddle around with the html on a given page (so in essence they use my php scripts, but their own html).

    Hopefully this is a clear question. And, since the way I set things up to start could have a major impact down the line ("satellite sites" that call to my server vs. everything under one server), any additional thoughts would be greatly appreciated.

    Thank you,

    Eric

  2. #2
    SitePoint Addict
    Join Date
    Apr 2011
    Posts
    266
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    When an URL adress is accessed for a php file, normally the server returns the results returned by the PHP script, not the code of the file. You can get the file, with all its code via FTP.
    Free: Web Programming Courses HTML, CSS, Flash
    Web Programming: AJAX Course and PHP-MySQL Course video Lessons
    Good JavaScript and jQuery course for beginners

  3. #3
    SitePoint Evangelist
    Join Date
    Mar 2011
    Location
    Bellingham, WA
    Posts
    450
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the quick response! I guess I misspoke a bit...I did in fact mean the results of the script. So, just to be clear....it would then be a possibility to run all of the scripts from one server, grabbing them from another server?

    Thanks again...


Bookmarks

Posting Permissions

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