MySQL Forums
Forum List  »  Full-Text Search

Re: PHP to grab the html from a URL and insert into MySQL
Posted by: Nick Roper
Date: July 26, 2004 11:55AM


> ISBN Number? Text from Book? Not sure what you mean here.

Sorry, my attempt at a joke. I just thought that you might want to go the whole way and get it to read paperbacks or something :-)

1. Warning: fopen() [function.fopen]: php_hostconnect: connect failed in f:\Inetpub\wwwroot\urlgrabber.php on line 59

2. Warning: fopen(http://www.mysite/test.asp) [function.fopen]: failed to create stream: Bad file descriptor in f:\Inetpub\wwwroot\urlgrabber.php on line 59

3. Notice: Undefined variable: okread in f:\Inetpub\wwwroot\urlgrabber.php on line 65

Any ideas?

Well, No 3 is down to sloppy programming on my part. Nos 1 and 2 look like it can't find the file associated with the URL. You've shown
'http://www.mysite/test.asp'; but you refer to a local site. If the site is on the local server then you may need to use:


I've tried it with a local site and it works fine. Are you using apache, or IIS ?

With regard to the OS, I was just thinking that it might be possible to retrieve a Word document (which is in binary format) and then pipe it through a string processor to get at the embedded text which could then be inserted into the datbase. For example, on Unix or Linux systems you could make a call to the os that used something like:

cat filename | strings

but I'm not sure what the equivalent would be on Windows.

Anyway, I'm away home now (whereabouts are you?) - I'll see if inspiration strikes during the night.


Nick Roper

Options: ReplyQuote

Written By
Re: PHP to grab the html from a URL and insert into MySQL
July 26, 2004 11:55AM
September 08, 2004 05:46AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.