I found an alternative to using file to get web content.

using fsockopen you can specify a useragent as per rfc-something which
handles it all very very nicely.

Its also nicer that what I was using to post and is looking more likely to
store cookies/sessions... but ill get to that later :)

thanks to anyone who thought about replying :)

Maybe this discovering might help someone else also, hence my post.



> -----Original Message-----
> From: Todd Pasley [mailto:[EMAIL PROTECTED]]
> Sent: Friday, 30 August 2002 6:19 PM
> Subject: [PHP] Useragent and file
> Hi
> Im using file() to get the contents of a webpage. e.g
> // get a web page into an array
> $fcontents= file ($targeturl);
> However I dont know how to mimic a different useragent. Using
> LWP::UA (in perl) i can pretend to be iexplore6 running on win2k
> or anything i want.. Is there a way i can do this in PHP?
> By changing the useragent will this also resolve problems with
> javascript?, I'd like the target server to think that I can view/run it.
> Thanks heaps,
> Todd.

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to