php-curl script that saves images---actually captcha images

Posted by user253530 on Stack Overflow See other posts from Stack Overflow or by user253530
Published on 2010-04-05T23:37:26Z Indexed on 2010/04/05 23:43 UTC
Read the original article Hit count: 605

Filed under:
|
|

I have a curl class, called Curl.

Let's presume i have this code:

$url = 'http://www.google.com'
$fields = array('q'=>'search term'); //maybe some other arguments. but let's keep it simple.
$curl = new Curl();
$page = $curl->post($url,$fields);

$page will have some images wich curl doesn't load them by default. I need to know how i can save a specific image without using curl. Once I use $page = $curl->post(..) I need to know how I can have that image saved without using another $curl->post(_image_location_) to get that file.

The reason why need this is to save a captcha image from a form. I need to access the form and get that specific image that's being loaded. If i try to access the URL of the image, it will be a different captcha image.

© Stack Overflow or respective owner

Related posts about php

Related posts about curl