Results 1 to 5 of 5

Thread: remote server includes

  1. #1
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default remote server includes

    So, say that server A has PHP installed, as does server B. Can server B include files from server A, and if so, is there any way to disable that (preferably without a die function in all of the scripts )?

    I am just concerned about the security of my scripts, some of which contain MySQL passwords, FTP passwords, etc. I've been looking online, but I can't find anything.
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  2. #2
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    If the server has allow_url_fopen set to on in the php.ini file, then you can get files from any browser accessible file on the other server. The only thing with this is that it will only use whatever is parsed and use that. In other words, if you have a php file like so:

    Code:
    <?php
     $var = 'test';
    ?>
    it will include a blank page; as compared to if you have this:

    Code:
    <?php
     $var = 'test';
     echo $var;
    ?>
    it will display the word "test". You can turn this off in the php.ini file.

    Hope this helps.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  3. #3
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    So other people cannot access functions/variables/classes/etc?
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

  4. #4
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Exactly.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  5. #5
    Join Date
    Jan 2007
    Posts
    629
    Thanks
    10
    Thanked 28 Times in 28 Posts

    Default

    I know I am starting to get annoying now, but just to be sure:

    You are saying that the include would essentially be the same as if the file was opened over on the internet? For example, if someone included this php page, they would get the same thing (in code) that we see? If so, that is a HUGE relief.

    And are you certain? (No offense, I just have to hear it to calm my paranoia ).

    Also, while I am at it, if you wanted to include the actual PHP source code, would you need to do an fread() to output it?

    Thanks,
    --Jas
    --Jas
    function GreatMinds(){ return "Think Like Jas"; }
    I'm gone for a while, but in the meantime: Try using my FTP script | Fight Bot Form Submissions

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
  •