1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

include() php files over the internet.

Discussion in 'Web Design & Development' started by Boylett, Feb 12, 2007.

Thread Status:
Not open for further replies.
Advertisement
  1. Boylett

    Boylett Thread Starter

    Joined:
    Dec 23, 2006
    Messages:
    55
    I am try to transfer stuff from server to server using php and variables. This is my variable place: http://vl.xendot.com/echo_vars.php. How do I include it in a file on a different website without it automaticly echoing?
     
  2. Gibble

    Gibble

    Joined:
    Oct 9, 2001
    Messages:
    27,087
    I don't think you can...it would be a security risk.
     
  3. namenotfound

    namenotfound

    Joined:
    Apr 30, 2005
    Messages:
    3,012
    If the PHP file contains any HTML, that will transfer, but I don't think any of the PHP would.

    If you had, for example a file on site1.com called "hello.php" with these contents:
    Code:
    <?php
    $world = "world";
    ?>
    Hello <?php echo $world; ?>
    And you tried to include it on site2.com, the output will only be:
    So you can include a .php file from one server to another, but it will only parse the HTML parts of that file.
     
  4. brendandonhu

    brendandonhu

    Joined:
    Jul 8, 2002
    Messages:
    14,681
    Above code would output "Hello world", but $world would not be set.

    Unless you want your PHP source to be visible to users, you would have to use some kind of authentication or password, or include() the file via FTP.
     
  5. Boylett

    Boylett Thread Starter

    Joined:
    Dec 23, 2006
    Messages:
    55
    Na you dont get it. Its open source to include over the internet so people can put it on there own site if they want. Anyway, I've found out a way to do it.

    P.S incase u didnt realise, my problem was just doing include() over the internet didn't set variables even if it did say $bla = 1;
    but i managed to fix that. Thanks for your help anyway.
     
  6. Sponsor

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/543456