class LIGTV
{
protected $ligtv_mail;
protected $ligtv_password;
public function __construct($mail, $password)
{
$this->ligtv_mail = $mail;
$this->ligtv_password = $password;
$a = $this->login("https://www.digiturkplay.com.tr/Club/Login/", true, null, "mail=".$this->ligtv_mail."&password=".$this->ligtv_password);
preg_match('%Set-Cookie: ([^;]+);%', $a, $b);
$c = $this->login("https://www.digiturkplay.com.tr/Club/Login/", true, $b[1], "mail=".$this->ligtv_mail."&password=".$this->ligtv_password);
preg_match_all('%Set-Cookie: ([^;]+);%', $c, $d);
$cookie = null;
for( $i=0; $i {
$cookie .= $d[1][$i] . ";";
}
echo $this->login("https://www.digiturkplay.com.tr/Club/Login/", null, $cookie, null);
}
public function login($url, $header = null, $cookie = null, $p = null)
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, $header);
curl_setopt($curl, CURLOPT_NOBODY, $header);
curl_setopt($curl, CURLOPT_REFERER, "https://www.google.com.tr/");
curl_setopt($curl, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
if($p)
{
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $p);
}
$result = curl_exec($curl);
if($result)
{
return $result;
}
else
{
return curl_error($curl);
}
curl_close($curl);
}
}
?>
sınıfta sizce nerede hata yaptım halen login olmuyor.