$proxy = '';
$ref = '';
$post_data ='';
$cookie_file_path = "./cookie.txt";
$agent = 'bot';
$target = 'http://jamiiforums.com';
$header = array ('Accept: text/javascript, text/html, application/xml, text/xml, */*','Accept-Language: en-us,en;q=0.5','Accept-Encoding: gzip, deflate','Connection: keep-alive', 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8', 'Pragma: no-cache', 'Cache-Control: no-cache', 'Content-Length: '.strlen($post_data));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $target);
curl_setopt($ch, CURLOPT_HEADER,1);
curl_setopt($ch, CURLOPT_REFERER, $ref);
curl_setopt($ch, CURLOPT_NOBODY, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path);
curl_setopt($ch, CURLOPT_USERAGENT, $agent);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 260);
curl_setopt($ch, CURLOPT_TIMEOUT, 250);
if($proxy){
curl_setopt($ch, CURLOPT_PROXY,$proxy);
}
if($post_data == TRUE){
curl_setopt($cURL,CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
}
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
curl_setopt($ch, CURLOPT_MAXREDIRS, 4);
if(preg_match ("/\bhttps:/", $target ) ) {
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
}
$page = curl_exec($ch);
curl_close($ch);
echo $page;