trying to capture url data to a stream, with a twist...

From: Date: Fri, 23 May 2003 07:48:00 +0000
Subject: trying to capture url data to a stream, with a twist...
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-27983@lists.php.net to get a copy of this message
i'm trying to capture output from a remote url(random.yahoo.com/fast/ryl) and use it on my site. however, the remote url output always leads with a Status 301 code, then outputs the data i want. as a result, the fopen() function thinks that the connection to the remote url fails, and goes no further. below is the code snippet i'm using to try and capture the stream, to no avail... function random_website() { $site = "http://random.yahoo.com/fast/ryl"; $open = fopen($site, "r"); $search = fread($open, 50000); fclose($open); $search = ereg("Location: (.*)", $search, $content); return $content[1]; } ultimately, what i want is the data given after the 301 code, which is a random url generated when you load the remote url. any thoughts or suggestions are welcome. thanks green

« previous php.db (#27983) next »