curl-and-php
RE: Help
Date: Mon, 24 Oct 2011 10:19:53 +1200
Thanks for your thoughts. I will rewrite everything when I got it working. I usually write the code and at the end
I write functions for the script.
The logo issue cannot be solved with the content-type. I took a look in the html code and saw that some images have url's like
images/logo/logo.png
Because of this I had to download the images because the php script dont know where to get the images.
So to display the images I created the folders, downloaded the images and they will be displayed. But thats not a good solution.
Is it possible to download them directly with curl?
From: dolan2go_at_yahoo.com
Subject: Re: Help
Date: Sun, 23 Oct 2011 15:16:32 -0400
To: curl-and-php_at_cool.haxx.se
Nelson,
Bitte sehr.The problem is that the logo I want to display does not work.
For the logo issue, you might try this:
// output to browserheader("Content-type: image/jpeg");print $response3;Additionally, a few other thoughts:1) You might have a typo in your code for the binary transfer:curl_setopt($ch2, CURLOPT_RETURNTRANSFER, TRUE);curl_setopt($ch, CURLOPT_BINARYTRANSFER, TRUE);curl_setopt($ch2, CURLOPT_HEADER, FALSE);
2) I usually do NOT add the first $header[] = "Host: www.google.de" & $header1[] = "Host: clients1.google.de" that you 'setzen'. Those are your server's sending headers.
3) You can shorten the code by reusing the $ch1 and reseting only the changing curl_setopt ( $ch1, ... ), before each consecutive curl_exec ( $ch1 ).4) cURL will handle cookies for you. It can be complicated, but curl will read, use and write them for you. curl_setopt($ch1, CURLOPT_COOKIE,$pref.'; '.$nid) may not be necessary and may complicate your attempts when the 'dynamic' cookies change. One of the COOKIEFILE or COOKIEJAR (not sure which) start cURL parsing cookie's and and together they 're-use' cookies across multiple scripts.
Please write back as necessary.
Weiderhören,
David
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2011-10-24