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: 197 All time: 8,495 This week: 190Up
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: 195177 in Italy Italy
Week rank: 107 Up4 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:197
This week:0
All time:8,495
This week:190Up