call to undefined function curl_init()

The script below, is a script that logs on to my VoIPBuster account and
(should) returns the remaining credit.
During debugging I found that the script stops at
$ch = curl_init();

I get Error message:
CALL TO UNDEFINED FUNCTION curl_init();

Can someone please explain what to do?

============================================================ =======================
<?php

function encryptString($string)
{
for($i=0; $i < strlen($string); $i++)
{
if(is_numeric($string[$i]))
{
if($string[$i] < "5")
$string[$i] = $string[$i] + 5;
else
$string[$i] = $string[$i] - 5;
}
}
return str_rot13($string);
}

// Set username and password
$username = encryptString('yyyyyyyyy');
$password = encryptString('xxxxxx');

$URL =
('https://myaccount.voipbuster.com/clx/index.php?part=plogin &username=' .
$username . '&password=' . $password);

// INIT CURL
$ch = curl_init(); //HERE THE SCRIPT STOPS !! :-(

# Setting CURLOPT_RETURNTRANSFER variable to 1 will force cURL
# not to print out the results of its query.
# Instead, it will return the results as a string return value
# from curl_exec() instead of the usual true/false.
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);

// EXECUTE 1st REQUEST (FORM LOGIN)
$store = curl_exec ($ch);
// SET Message
curl_setopt($ch,
CURLOPT_URL, 'https://myaccount.voipbuster.com/clx/notifications.php');


// ENABLE HTTP POST
curl_setopt ($ch, CURLOPT_POST, 1);

// SET POST PARAMETERS : FORM VALUES FOR EACH FIELD
curl_setopt ($ch, CURLOPT_POSTFIELDS, '?fromlogin=true');



// EXECUTE 2nd REQUEST (Send Message)
$content = curl_exec ($ch);

// CLOSE CURL
curl_close ($ch);

/*
At this point you can do do whatever you want
with the downloaded file stored in $content :
display it, save it as file, and so on.
*/

//we gaan evenetje knippen in de ruwe source code van de returnwaarde
//bestudeer de html source en alles wordt duidelijk
$start = strpos($content,'balanceid'); //bepaal start van balanceid
$deelstring = substr($content,$start+26,10); //kopieer het begin van het
bedrag de string naar een tussen waarde
//print $deelstring;
$einde = strpos($deelstring,'<'); //einde van het bedrag is waar de afsluit
tag begint
$bedrag = substr($deelstring,0,$einde);
print $bedrag;
?>
============================================================ =======================
Henk Oegema [ Fr, 11 Mai 2007 11:25 ] [ ID #1710030 ]

Re: call to undefined function curl_init()

Henk oegema wrote:
> The script below, is a script that logs on to my VoIPBuster account and
> (should) returns the remaining credit.
> During debugging I found that the script stops at
> $ch = curl_init();
>
> I get Error message:
> CALL TO UNDEFINED FUNCTION curl_init();

From the php website

In order to use PHP's cURL functions you need to install the » libcurl
package. PHP requires that you use libcurl 7.0.2-beta or higher. In PHP
4.2.3, you will need libcurl version 7.9.0 or higher. From PHP 4.3.0,
you will need a libcurl version that's 7.9.8 or higher. PHP 5.0.0
requires a libcurl version 7.10.5 or greater.

Arjen
--
http://www.hondenpage.com - mijn site over honden
Dave Williams [ Fr, 11 Mai 2007 15:20 ] [ ID #1710035 ]
PHP » alt.php » call to undefined function curl_init()

Vorheriges Thema: Uploading by FTP and line ending settings
Nächstes Thema: Where to find PHP scripts?