PHP Code:
class Wrapper {
public function Post($Url, $Variables){
if(!function_exists("curl_version")) return false;
$Handle = curl_init();
curl_setopt($Handle, CURLOPT_URL, $Url);
curl_setopt($Handle, CURLOPT_POST, 1);
curl_setopt($Handle, CURLOPT_POSTFIELDS, $Variables);
curl_setopt($Handle, CURLOPT_HEADER , 0);
curl_setopt($Handle, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($Handle, CURLOPT_RETURNTRANSFER, 1);
return curl_exec($Handle);
}
public function Get($Url){
if(!function_exists("curl_version")) return false;
$Handle = curl_init();
curl_setopt($Handle, CURLOPT_URL, $Url);
curl_setopt($Handle, CURLOPT_HEADER , 0);
curl_setopt($Handle, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($Handle, CURLOPT_RETURNTRANSFER, 1);
return curl_exec($Handle);
}
}
Results 1 to 1 of 1
Thread: [PHP] HTTP Wrapper Class
- 16 Nov. 2009 06:00am #1
- Age
- 30
- Join Date
- Nov. 2009
- Location
- Anaheim, California
- Posts
- 1,065
- Reputation
- 99
- LCash
- 500.00
[PHP] HTTP Wrapper Class
Last edited by Chris; 16 Nov. 2009 at 06:28am.