azer |
Beginner |
|
|
Joined: May 18, 2013 |
Posts: 4 |
|
|
|
|
|
|
|
Yarım kırdı a.q
Code: | <?php
function fcurl($adres, $post = NULL, $silme = 0, $ref = NULL)
{
if ($silme == 1) {
file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/cookie.txt', '');
$ch = $_SERVER['DOCUMENT_ROOT'] . '/cookie.txt';
curl_setopt($ch, CURLOPT_URL, $adres);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
}
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13');
if ($ref == NULL) {
curl_setopt($ch, CURLOPT_REFERER, 'http://tr.hititbet.com/Sports.html');
curl_setopt($ch, CURLOPT_REFERER, $ref);
curl_setopt($ch, CURLOPT_COOKIEJAR, $_SERVER['DOCUMENT_ROOT'] . '/cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, $_SERVER['DOCUMENT_ROOT'] . '/cookie.txt');
}
else {
$header = array('Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language: en-us,en;q=0.5', 'Accept-Charset:ISO-8859-9,utf-8;q=0.7,*;q=0.3', 'Keep-Alive: 300', 'Referer:http://tr.hititbet.com/Sports.html', 'Connection: keep-alive', 'Accept-Language:tr-TR,tr;q=0.8,en-US;q=0.6,en;q=0.4', 'Host:tr.hititbet.com', 'Host:tr.hititbet.com', 'Cache-Control: max-age=0', 'Accept-Encoding: gzip,deflate,sdch');
}
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
return str_replace('<?xml version="1.0" encoding="ISO-8859-9" ?>', '', curl_exec($ch));
}
class betgamesoft
|
|
|