You are here: Re: [PHP] get image from browser url. « PHP « IT news, forums, messages
Re: [PHP] get image from browser url.

Posted by Jochem Maas on 03/08/05 06:00

buck Wheat wrote:
> Hello all,
>
> I am writing a script that uses curl to access a
> webpage that is password protected and uses cookies.
> The webpage displays a graph on my browser and I would
> like to capture and save that graph to a file.
>
> This is the url I am using in curlopt_url :
>
> http://10.10.10.22:8080/NetPerfMon/ViewChart.asp?Chart=AVGRTLOSS&NetObject=N:4&Period=Today&SampleSize=30M&ReBuild=TRUE&FontSize=Medium&Width=640&Height=0")
>
> If I cut and paste this to my browser the graph gets
> displayed but when I use my sript this is the ouput of
> the curl_exec:
>
> <img
> src="/NetPerfMon/Chart.asp?Chart=AVGRTLOSS&NetObject=N:4&Period=Today&SampleSize=30M&ReBuild=TRUE&FontSize=Medium&Width=640&Height=0"
> border="0">

from the output of curl_exec extract the url:

/NetPerfMon/Chart.asp?Chart=AVGRTLOSS&NetObject=N:4&Period=Today&SampleSize=30M&ReBuild=TRUE&FontSize=Medium&Width=640&Height=0

then make another call with curl_exec() using that url
the data you get back should be the image, save it to disk.


....thats basically what you browser would do.

or just use that url iso the url that you are currently
using (the one that outputs a page with (only!?) an img tag in it.)

>
> Which is not what I want, I actually want to grab and
> save the image that I see on my browser.
>
> Can this be done and can someone help me out ?
>
> Thanks,
>
> --
> buck
>
>
>
> ---
> Emanuele Buttice
>
>
>
>
> __________________________________
> Celebrate Yahoo!'s 10th Birthday!
> Yahoo! Netrospective: 100 Moments of the Web
> http://birthday.yahoo.com/netrospective/
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация