PHP Classes

EasyCURL : Simple wrapper around Curl to send HTTP requests

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 198 All time: 8,502 This week: 455Up
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
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 (2)  
File Role Description
Plain text file EasyCurl.php Class EasyCurl
Accessible without login Plain text file Example.php Example Curl_example

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:198
This week:0
All time:8,502
This week:455Up