On Mon, Nov 12, 2001 at 04:42:08PM -0000, Caspar Kennerdale wrote:

> I am yrying to read free urls from a moreover.com to a director app which
> will be a news reader without a browser
> 
> 'm using php top extrat the headlines
> 
> each headline looks similar to this
> 
> ("http://c.moreover.com/click/here.pl?l27536670";)
> 
> 
> If a browser goes to this page then it is redirected to the appropriate page
> ie www.newssite.com/etc/etc/etc
> 
> Director does not interpret the redirection.
> 
> Can anyone think of a way for a script to go the to the moreover link and
> then return the 'real url as a variable or as an array of links (if multiple
> headlines are required

You can open a socket to the web server with PHP and grab the Location
header from the response.

See the fsockopen() man page for examples, or sendtohost.txt for a
simple function to handle passing the right headers.

http://www.php.net/manual/en/function.fsockopen.php
http://dodds.net/~cardinal/sendtohost.txt

Matt

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to