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

curl-and-php

Can't do GET requests!!!

From: Oriol Magrané <omagrane_at_anthill.es>
Date: Wed, 26 Jun 2002 14:08:32 +0200

    Hello!
    I've set up this little script:

    <?
        $ch = curl_init("https://www.google.com?variable=value");
        if ($ch)
        {
              curl_setopt($ch, CURLOPT_HEADER, 0);
              curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
              curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
              $output = curl_exec($ch);
              $info = curl_getinfo($ch);
              $errno = curl_errno($ch);
              $errtxt = curl_error($ch);
              curl_close($ch);
              while (list($k,$v) = each($info)) echo "\t$k = $v\n";
              echo "Error: $errno ($errtxt)\n";
        }
?>

    ...and when I run it, it gives me a lookup error (Couldn't resolve host
'www.google.com?variable=value'). Is this the way of making standard curl
GET requests within PHP, or am I doing something wrong?

    Thank you very much!

    Oriol

-------------------------------------------------------
This sf.net email is sponsored by: Jabber Inc.
Don't miss the IM event of the season | Special offer for OSDN members!
JabConf 2002, Aug. 20-22, Keystone, CO http://www.jabberconf.com/osdn
Received on 2002-06-26