Welcome to a mine field of problems :-)

1. The url you have entered is invalid. Thats a good first check to make usually. Try /search?q=test to get that bit sorted.

2. Google prevents known useragents from accessing it's content as it believes you are acting as a spider or a search engine stealing thier content. To counter this you need to use a new url capturing method and specifically set the name of the useragent. Use 'MSIE'. You can use curl, lwp etc to do this kind of thing.
Curl is excellent, fast, highly configurable and execellent with secure connections.


3. I suggest you don't do this - they prevent it for a reason.

Jim




Jens Lehmann wrote:



For reading in and displaying a file $uri I use this short script:


 $uri = 'http://www.google.de?q=test';
echo implode('',file($uri));
?>

Of course this works well for almost every website, but I have problems reading in the results of google (for instance the URI above). The error message I get is:

[07-Mar-2003 16:14:13] PHP Warning: file("http://www.google.de?q=test";) - Success in /var/www/test/getfile.php on line 20
[07-Mar-2003 16:14:13] PHP Warning: Bad arguments to implode() in /var/www/test/getfile.php on line 20


Does anyone know why this happens?

I use PHP 4.23 and Apache 1.3.26 on Debian GNU/Linux 3.0.

Jens







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



Reply via email to