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

curl-and-php

Re: Help with Encoding?

From: Brian Wilkins <brian_at_hcc.net>
Date: Mon, 11 Oct 2004 16:47:06 +0600

It's perl. Substitute for PHP and voila.

Here is a PHP example:

function connect_ticket($Service, $vars, $DC_NUM) {
        $ch = curl_init();
        $agent = "Mozilla/4.0";
        $DCNUM = $DC_NUM;
        curl_setopt($ch, CURLOPT_URL, "https://www.url.cc/cgi-bin/script.cgi");
        curl_setopt($ch, CURLOPT_POST,1);
        curl_setopt($ch, CURLOPT_USERAGENT, $agent);
        curl_setopt($ch, CURLOPT_POSTFIELDS,
"Service=$Service&PIN=$DCNUM&PostData=$vars");
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 1);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_TIMEOUT, 100);
        curl_setopt($ch, CURLOPT_VERBOSE, 1);
        $response = curl_exec($ch);
        $succeeded = curl_errno($ch); // == 0 ? true : false;
        curl_close($ch);
        return $response;
}

-- snip --

> Is that php?
> Where, who, how and why? ;-)
>
> Can you help me understand what you're doing or help me fix what *im*
> doing? - would be most appreciated..
>
> very interesting code, just dont have a clue what it is! lol..
> what's a 'sub' for example?
>
> --
> Nick W

--
Brian Wilkins
brian_at_hcc.net
Software Engineer
Heritage Communications Corporation
  Melbourne, FL     USA     32935
Received on 2004-10-11