This is probably something really easy that i've forgotten about, but i'm trying to include another web site, within my site. such as :

<?php

include("header.inc");
include("www.somewhereelse.com");
include("footer.inc");

?>

which is what i have now but it doesn't work, can anyone pelase help me 🙂 thanks

    <?php

    include("header.inc");
    include("www.somewhereelse.com");
    include("footer.inc");

    ?>

    Try to begin the url with http:// . If that doesn't work, check out fopen().

      have tried it with the http://www.somewhereelse.com and with fopen("http://www.somewhereelse.com","r") i do not, personally, understand why its not working 🙁 thankyou anyway

        Checked the manual:

        If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), you can specify the file to be include()ed using an URL instead of a local pathname. See Remote files and fopen() for more information.

        ...

        If the include()ed file is called via HTTP using the fopen wrappers, and if the target server interprets the target file as PHP code, variables may be passed to the include()ed file using an URL request string as used with HTTP GET. This is not strictly speaking the same thing as include()ing the file and having it inherit the parent file's variable scope; the script is actually being run on the remote server and the result is then being included into the local script.

        Maybe it would be worthwhile to check.

        HTH,

        Jim Hawley

          Write a Reply...