Are you looking at the site the calling script is on? I had the same problem
spidering my site to build a search engine. Using "http://localhost/";
instead of the site address got it working.

I find that file() works fine on external pages but falls over (in exactly
the same way as yours) when accessing local pages by web address instead of
localhost.

At the time my guess was that it was something to do with the firewall
thinking it was being spoofed (external call with an internal IP address),
but I'm a bit out of my depth here so that could be complete bollocks.

Anyway, hope this is of some help.

        Tim Ward
        Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html


> -----Original Message-----
> From: James Kneebone [mailto:[EMAIL PROTECTED]]
> Sent: 26 April 2001 12:57
> To: [EMAIL PROTECTED]
> Subject: Parsing HTML files from an external web server
> 
> 
> Hello List.
> 
> I'm having a little trouble with parsing HTML files and 
> inputting the data
> from
> the HTML file into a MySQL database. I get the following 
> error when trying
> toparse the file.
> 
> Warning: file("http://www.server.com/file.htm";) - No error in
> d:\webpages\world\lists.php on line 8
> 
> The following is part of my php code
> 
> <?
> 
> $url = "http://www.server.com/file.htm";;
> 
> $fileArray = file($url);
> 
> $state = 0;
> $line = 0;
> $ProvinceCount = 0;
> 
> $Details = Array();
> 
> ****************
> 
> I then have more code which parses the file and parses the 
> data and puts it in
> an array.
> 
> I was wondering whether anybody could provide information as 
> to what the
> possible problem could be. If you want more information, 
> please contact me
> off-list.
> 
> Thanks,
> 
> James  
> 

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