curl-and-php
Re: Help
Date: Sun, 23 Oct 2011 15:16:32 -0400
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 browser
header("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
Received on 2011-10-23