cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: PHP - CURL - Custom authentication script

From: Michael Gawrychowski <mgawrych_at_excelmicro.com>
Date: Tue, 29 Mar 2011 11:34:29 -0400

Thank you for your prompt response. I tried to use verbose but I don't get
any output. I tried to make it very simple:

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, "http://www.google.com");
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_VERBOSE, true);
        $content = curl_exec ($ch);
        echo $content;

and still nothing. Is there anything Im missing here? When verbose is on,
should I get an output printed on the screen automatically?

On Tue, Mar 29, 2011 at 10:32 AM, David Colter <dolan2go_at_yahoo.com> wrote:

> Have you looked into Live HTTP Headers (a Firefox plugin)? In my experience
> with similar processes, there are many parts of the transfer that have to be
> 'just so' before the desired response comes back.
>
>
I checked the headers and they look ok. I will try to compare everything as
soon as I get the verbose function to work.

> > I checked all cookies generated by cURL and I compared them to cookies
> created by Firefox (Firebug extension for cookies). They all look the same.
> I also double checked all of the $_POST variables. They all look correct.
>
> Do you have curl verbose output turned on?
> With the blank screen, what is the HTTP status code?
>
>
I just added the following code:

          print "<pre>\n";
          print_r(curl_getinfo($ch)); // get error info
          echo "\n\ncURL error number:" .curl_errno($ch); // print error
info
          echo "\n\ncURL error:" . curl_error($ch);
          print "</pre>\n";

and it returns this:

Array
(
    [url] => https://c.na4.visual.force.com/apex/NewCase?retURL=%2F500%2Fo&save_new=1&sfdc.override=1
    [content_type] => text/html; charset=UTF-8
    [http_code] => 200
    [header_size] => 1777
    [request_size] => 2028
    [filetime] => -1
    [ssl_verify_result] => 19
    [redirect_count] => 3
    [total_time] => 2.074
    [namelookup_time] => 0
    [connect_time] => 0
    [pretransfer_time] => 0
    [size_upload] => 0
    [size_download] => 140943
    [speed_download] => 67957
    [speed_upload] => 0
    [download_content_length] => 126
    [upload_content_length] => -1
    [starttransfer_time] => 0.982
    [redirect_time] => 0.156
)

cURL error number:0

cURL error:

One of the input fields has a very very long value and I of course try to
submit it too. Do you think that it matters?

Thank you for help
M.

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2011-03-29