Re: fopen()

From: Date: Sat, 20 Jul 2002 00:26:56 +0000
Subject: Re: fopen()
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-108603@lists.php.net to get a copy of this message
hi, I think there are some reserve character in your url and so can you do one thing $url="http://www.google.com/search\?hl=en\&\&ie=ISO-8859-1q=asdf"; if (!($fc = fopen("$url", "r"))) { echo "couldnt open file."; } else { $content = fread($fc,10000000); } echo "$content\n"; Thanks Vinod -- Vinod Palan A Calypso Technology, Inc. Vinod_palan@calypso-tech.com (415) 817-2463 Phone "Chris Knipe" <savage@savage.za.org> wrote in message news:001901c22f7e$99e54740$fe01a8c0@genocide... > Lo all, > > if (!($fc = > fopen("http://www.google.com/search?hl=en&&ie=ISO-8859-1q=asdf", "r"))) { > echo "couldnt open file."; > } else { > $content = fread($fc,10000000); > } > echo "$content\n"; > > Why doesn't this work? > > The browser reports the following back: > > Warning: fopen("http://www.google.com/search?hl=en&&ie=ISO-8859-1q=asdf", > "r") - No error in c:\megalan\htdocs\test2.php on line 17 > couldnt open file. > > Needless to say, I'm completely clueless on this one. All the code is > right, when I change the URL to be something more sanitally correct such as > http://server.com/file.extension it works perfectly. > > -- > me > >

« previous php.general (#108603) next »