<?php
function siteConnect($site){
$username="username";
$password="password";
$cookie="cookie.txt";
$postdata = "username=$username&password=$password&submit=Gir! ";
$ch = curl_init();
$hc = "YahooSeeker-Testing/v3.9 (compatible; Mozilla 4.0; MSIE 5.5; Yahoo! Search - Web Search)";
curl_setopt($ch, CURLOPT_URL, $site);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_USERAGENT, $hc);
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_REFERER, 'http://r10.net');
curl_setopt ($ch, CURLOPT_POSTFIELDS, $postdata);
curl_setopt ($ch, CURLOPT_POST, 1);
= curl_exec($ch);
curl_close($ch);
return $loginpage;
}
funtion temizle($data)
{
preg_match_all('@<title>(.*?)</title>@si',$data,$veri_derece1);
return $veri_derece1[1][0];
}
$giris = siteConnect('http://siteadresi.com/takelogin.php');
$datasiten = siteConnect('http://siteadresi.com/almakistedigin.php');
echo temizle($datasiten);
?>