Re: fread usage



vito wrote:
after reading your comments,

i made some changes.

1)switch to use "acd" instead of "big problem"
2)try use file_get_contents instead


$theFile ="http://images.google.com/images?q=acd";;


the $content contains:

<img src=/images?q=tbn:8w7TF3ADocTy3M:cheminf.cmbi.ru.nl/cheminf/isis/pict/acd_price.gif width=134 height=105>

but i just don't know why

$matchno = preg_match_all("/.*<img src=/images?q=tbn:.*:(.*) width=.*>.*/", $content, $regs);

returns nothing. ($matchno echo nothing)

furthermore, how is Jerry able to count the size? could anybody tell me? indeed, i need not retrieve the whole content but just a single little image is grateful.




Vito,

I was looking at your fread() call - you say get up to 9*1024*1024 bytes - which is 9 mb.

And you are getting the correct information back. When you fetch a page containing images, the webserver returns <img> tags. The browser must then go out and fetch each of those images.

Open the page with your query and then look at the HTML source. This is what your program should be getting. Writing that to the user's browser should cause the browser to initiate further connections to retrieve the data.

As for your regex - ? is a control character (makes the preceding character optional). You need to escape it, i.e.

... images\?q=tbn ...

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • Re: Event Matchmaker updated
    ... > critique without giving constructive feedback. ... all the thumbnail images are full size images ... being resized by the browser. ... - The FAQ pages don't look anything like any FAQ I've ever seen, ...
    (rec.juggling)
  • Re: Struggling to convert this layout into CSS
    ... And if 800px is to be "merely used for testing purposes," then next time say, "imagine I have a site set at 800px, fixed for testing purposes." ... If you wish to test it, then all you have to do is copy and paste and save the images I linked. ... Because I have Firefox set as my default browser, ... In the sample code I gave the background are fixed on either side of the content div, not on either side of the browser window. ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Editing HTML in publisher
    ... Images look like *very* poor gifs though - the did before as well, ... So first of all what browser and which version are you using to view ... have grouped together those design elements. ... Quality Service" which are not in my original publisher file. ...
    (microsoft.public.publisher.webdesign)
  • Re: Editing HTML in publisher
    ... But it is much harder to get banner images looking correct. ... The compress graphics feature does not work on graphics smaller than 100 kb, ... In the browser go to Help and then About IE or FF ... to the home page even though it is correct on my publisher ...
    (microsoft.public.publisher.webdesign)
  • Re: )s correct C-Move Response Status 0x000(Success) if no images have been retrieved yet?
    ... retrieve the images too. ... this PACS and It sends Pending status while there are pending ... Our theory is that PACS always send status Success ...
    (comp.protocols.dicom)