Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 2 of 2
  1. #1
    Member tlcook's Avatar
    Join Date
    Nov 2006
    Posts
    38
    Member #
    14386
    Hi all, I am trying to get a page from another server displayed within my page using PHP. But I'm unsure as to how to do it.. I own both servers, but I want a file from one to be included in another after being processed and formatted etc.. Can anybody help?

  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    I was going to mention that you would need permission, but you covered that.

    Code taking from http://uk2.php.net/manual/en/function.file.php

    PHP Code:
    <?php
    // Get a file into an array.  In this example we'll go through HTTP to get
    // the HTML source of a URL.
    $lines file('http://www.example.com/');

    // Loop through our array, show HTML source as HTML source; and line numbers too.
    foreach ($lines as $line_num => $line) {
       echo 
    "Line #<b>{$line_num}</b> : " htmlspecialchars($line) . "<br />\n";
    }

    // Another example, let's get a web page into a string.  See also file_get_contents().
    $html implode(''file('http://www.example.com/'));
    ?>


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 08:10 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com