Skip to content

s1lviu/SimpleCurl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SimpleCurl

Simple and easy to use php curl class with examples

<?php 
//Simple Curl
//Author: Silviu Bogdan Stroe 
//Contact: silviu[at]silviu-s.com - www.silviu-s.com
include('curl.php');

$obj = new curl;
$obj->url("https://www.whatismybrowser.com/developers/what-http-headers-is-my-browser-sending"); //set url
$obj->referer("https://rstforums.com/"); //set referer
$obj->cookies(true);  //disable or enable cookies from file
$obj->followredirect(true);  //follow or not HTTP redirects
$obj->timeout(10); //connection timeout
$obj->setcookies("Cookie: cookie1=cookie; cookie2 = anothercookie"); //set your own cookies
$obj->setheaders(array("X: Y")); //set your own headers in netscape format
$obj->useragent('User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:34.0) Gecko/20100101 Firefox/34.0'); //set your own user-agent
//$obj->post(array('field1' => 'value1', 'field2'=> 'value2')); //example for make HTTP-POST for fields or files. 

echo $obj->getdata(); //get result

?>

About

Simple and easy to use curl php class with examples

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages