Click to See Complete Forum and Search --> : Installation of cURL Libraries
brij_theinvader
06-02-2007, 03:48 AM
hi,
Whenever i run the script containing cURL commands,in my Easy PHP editor, it shows me error.
so, how can i install cURL libraries into my Easy PHP editor. Finally i want to run the cURL commands. Please Help.
also if it is not possible to include cURL libraries into Easy PHP, then show me some other ways of running cURL commands. I have PHP 5.1 installed.
Waiting for reply.
Thanks and Regards,
Brij.
bradgrafelman
06-02-2007, 04:35 AM
then show me some other ways of running cURL commands. I have PHP 5.1 installed.On Windows?
If so, simply find your php.ini file and uncomment the extension line for php_curl.dll and restart your webserver.
brij_theinvader
06-02-2007, 06:16 AM
okay i did this and started curl.
Now i executed this code 1st script:
<?php
//
// A very simple PHP example that sends a HTTP POST to a remote site
//
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,"http://127.0.0.1:8080/curltesting.php");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS,"usname=brij&password=brijguru");
curl_exec ($ch);
curl_close ($ch);
?>
I got blank page as output .
in curltesting.php the following codes were written :
<?php
$usname=$_POST['usname'];
$password=$_POST['password'];
echo $usname ." ". $password;
?>
So what do u suppose , what did the 1st script did?
bradgrafelman
06-02-2007, 08:05 PM
There's two things you need to do:
Use curl_setopt() to enable CUROPT_RETURNTRANSFER (so that you can retrieve the outputted data which is otherwise discarded).
Echo the returned value of curl_exec (assuming it isn't FALSE, which means an error occurred).
PHP Builder
Copyright WebMediaBrands Inc. All Rights Reserved.