>// 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?

Yes, but you'll need to roll your own function with fsockopen($host, 80).

Some sample code (using POST instead of GET) would be Rasmus "SendToHost"
function from oh so long ago.  Google "Rasmus Lerdorf and SendToHost" and
it'll turn up.

>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.

You'll have to figure out what data to send to "fool" them well enough, but
it should be simple enough to convince the server that you "can" run
JavaScript.

But then if their site requires that you actually *DO* run the JavaScript to
navigate or do something useful, you're on your own for figuring out how to
get from A to B and send them back the JavaScript-modified data.

-- 
Like Music?  http://l-i-e.com/artists.htm


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

Reply via email to