|
Project Information
Featured
Downloads
|
CurlxCurlx is a PHP5 wrapper class for cURL functions. Examples
$curlx = new Curlx;
$web_page = $curlx->fetch('http://example.com/');
$curlx = new Curlx;
$web_page = $curlx->fetch('http://example.com/', array('username' => 'User', 'password' => 'pa55word'));
// Imagine you're using a social networking site on example.com,
// and you want your PHP script to log in and update your profile for you.
$curlx = new Curlx;
// This file will be used whenever there's cookie data to be stored or sent to the server.
$curlx->cookie('my_cookie.text');
// Send a POST request containing your username and password to the login page
$response = $curlx->fetch('http://example.com/login', array('username' => 'User', 'password' => 'pa55word'));
// Randomly pick a mood for your new profile status
$moods = array('happy', 'sad', 'angry');
$current_mood = $moods[mt_rand(0, count($moods) - 1)];
$status = "I am $current_mood today!";
// Do a status update on your example.com profile
$response = $curlx->fetch('http://example.com/profile', array('status' => $status));Bugs?Tell me and I'll fix it! - http://code.google.com/p/curlx/issues/entry |