Re: Accessing a website from within a php script

From: Date: Tue, 13 Jan 2004 10:43:45 +0000
Subject: Re: Accessing a website from within a php script
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-174422@lists.php.net to get a copy of this message
Børge Strand wrote:
Here's what I do next with it. Only now this file (www.boggle.no/test6.php) times out in the brower. Do you see something that it obviously wrong here? <?php
    print '<html><body>' . "\n";
    print 'test6.php<br>';
    $fp = fopen("http://www.boggle.no/message.txt", "r");
    $contents = fread($fp);
    print $contents;
    fclose ($fp);
    print '</body></html>' . "\n";
?>
fread takes 2 parameters: the file pointer and the number of bytes to read. See http://php.net/fread for full info. -- Stuart

« previous php.general (#174422) next »