function connect($url, $post = '')
{
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.100 Safari/534.30');
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, $post);
curl_setopt($curl, CURLOPT_COOKIEFILE, dirname(__FILE__) . '/cookies.txt');
curl_setopt($curl, CURLOPT_COOKIEJAR, dirname(__FILE__) . '/cookies.txt');
$result = curl_exec($curl);
curl_close($curl);
return $result;
}
if(file_exists('cookies.txt'))
{
echo connect('http://www.SİTE.com/private.php');
}
else
{
connect('http://www.SİTE.com/member.php', 'action=do_login&url=/private.php&username=NICK&password=PASS');
str_replace('/','',$_SERVER["PHP_SELF"]);
header('Location: '.$_SERVER["PHP_SELF"]);
}
?>
Bilginiz var ise ve yardımcı olur iseniz çok sevinirim.
Kolay gelsin iyi günler.