PHP Classes

EasyCURL : Simple wrapper around Curl to send HTTP requests

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 198 This week: 1All time: 8,496 This week: 560Up
Version License PHP version Categories
easycurl 1.0GNU Free Document...5HTTP, PHP 5
Description 

Author

This class is a simple wrapper around Curl to send HTTP requests.

It can create a Curl request handle and set the options for the request.

The class can execute the request and return the response results.

Picture of Dawood Ikhlaq
  Performance   Level  
Name: Dawood Ikhlaq <contact>
Classes: 8 packages by
Country: Italy Italy
Age: 29
All time rank: 194776 in Italy Italy
Week rank: 106 Up3 in Italy Italy Up
Innovation award
Innovation award
Nominee: 4x

Example

<?php
   
require("Easycurl.class.php");
   
$url="http://192.168.15.1:8000/";
   
$data=array(
   
"auth_user"=>"admin",
   
"auth_pass"=>"admin",
   
"redirurl"=>"",
   
"accept"=>"ACCETTA+E+CONTINUA"
   
);
   
$options=array(
   
CURLOPT_URL=>$url,
   
CURLOPT_POST=> 1,
   
CURLOPT_POSTFIELDS=>http_build_query($data),
   
CURLOPT_FOLLOWLOCATION=> 1,
   
CURLOPT_RETURNTRANSFER=>1
   
);
   
   
$ch = new curl($options);
   
$result= $ch->result();
   
   
//echo $result.PHP_EOL;
   
   
if(strstr($result,'Logout'))
    {
       
printf("Login was Successfull\n");
    }else
    {
       
printf("Login was unSuccessfull\n");
    }
   
   
?>


  Files folder image Files  
File Role Description
Plain text file EasyCurl.php Class EasyCurl
Accessible without login Plain text file Example.php Example Curl_example

 Version Control Unique User Downloads Download Rankings  
 0%
Total:198
This week:1
All time:8,496
This week:560Up