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

curl-and-php

about new curl version

From: Johnny Karlsson <johnny_k76_at_yahoo.com>
Date: Fri, 19 Dec 2003 15:30:43 +0100 (CET)

Hi, i have created a php-script that logs in to a
server that gives users at my University
internet-access. The problem is that the script worked
fine before i upgraded to fedora core 1(curl version
curl-7.10.6-7 and php-4.3.3-6). After that it just
doesn't work.
The server uses ssl login.
What could be the problem?

//Johnny Karlsson

$user_agent = "Mozilla/4.0 (compatible; MSIE 5.01;
Windows NT 5.0)";

if ( NetUp($host[1]) == 0)
{

//Initialize a CURL session
$ch = curl_init();

//Set the different options.
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt ($ch,CURLOPT_TIMEOUT,45);
curl_setopt ($ch, CURLOPT_URL, $url[1]);
curl_setopt ($ch, CURLOPT_VERBOSE, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $LoginString);

        //Perform The Curl session
        $result = curl_exec ($ch);

        //Echo status messages.
        if ( strstr($result,"IP-login ACCEPTED") )
        {
                $date = exec('date');
                echo("$date Login Successful!\n");
        }
        else
        {
                echo("Unknown error!");
        }

        //Close the curl handle
        curl_close ($ch);

Höstrusk och grå moln - köp en resa till solen på Yahoo! Resor på adressen http://se.docs.yahoo.com/travel/index.html

-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills. Sign up for IBM's
Free Linux Tutorials. Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
Received on 2003-12-19