This is a discussion on "help on using curl" within the PHP Forum section. This forum, and the thread "help on using curl are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
help on using curl
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
help on using curl
hi,
i wanted to accomplish these task: 1. from that webservice get a certain set of strings from the header 2. next, generate the image. and these 2 steps will be done at the same time. to get the header value: $ch = curl_init(); $timeout = 0; curl_setopt ($ch, CURLOPT_URL, $xmyurl); curl_setopt($ch, CURLOPT_HEADER, 1); ob_start(); curl_exec($ch); $s=ob_get_contents(); now from the same url i want also to generate the image on the file. if just to create the image: $ch = curl_init(); $timeout = 0; curl_setopt ($ch, CURLOPT_URL, $xmyurl); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); // Getting binary data curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); $image = curl_exec($ch); curl_close($ch); now...how to combine both functions? |
|
|
|
|||
|
Re: help on using curl
these are two tasks:
first get the string with cURL second create the dynamic image with imagemagick or GD |
|
|||
|
Re: help on using curl
how to get the string with curl? can you give me a sample? because when i tried putting all things together:
ch = curl_init(); $timeout = 0; curl_setopt ($ch, CURLOPT_URL, $xmyurl); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1); ob_start(); curl_exec($ch); $s=ob_get_contents(); . . . i cant get the image. is there a way for me to do it with curl without using imagemagick. yes we do have gd and im applying it in creating the image on the fly. |
|
|||
|
Re: help on using curl
http://www.web-development-blog.com/...reg_match_all/ note that cURL is only a function to get a remote file (thats all)
|
![]() |
| Tags |
| curl, image, imagepng, php |
| Thread Tools | |
|
|