$cookie_file = 'cookie.txt';
$c = curl_init('http://managerzone.com/');
curl_setopt($c, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($c, CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($c, CURLOPT_URL, 'http://managerzone.com/?p=login&lang=pl');
curl_setopt($c, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12;MEGAUPLOAD 1.0");
curl_setopt($c, CURLOPT_POST, 1);
curl_setopt($c, CURLOPT_POSTFIELDS,
'username=xxxx&password=xxxxxx&remember_me=1');
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_getinfo($c);
$s = curl_exec($c);
curl_close($c);
$url = 'http://managerzone.com/?p=clubhouse';
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12;MEGAUPLOAD 1.0");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
$result = curl_exec($ch);
curl_close($ch);
$pattern = '(#Ligi Juniorskie(.*) dni zapisów#)';
$ile = preg_match_all($pattern, $result, $matches, PREG_PATTERN_ORDER
);
for ($i=0; $i<count($ile); $i++) {
echo ($matches[0
][$i]) . '<br>'; }
zrbiłem takie coś ale nie działa

# Netscape HTTP Cookie File
# This file was generated by libcurl! Edit at your own risk.
managerzone.com FALSE / FALSE 0 PHPSESSID xxxxxxxxxxxxxxxxx
managerzone.com FALSE / FALSE 000000 MZLANG pl
managerzone.com FALSE / FALSE 00000000 MZLOGIN 0
plik cooke generuje sie tak - tylko wszelkie liczby usunełem ;]
Tak jak sprawdziłem to logowanie wychodzi dobrze wiec coś z tym kodem musi byc nie tak:
$url = 'http://managerzone.com/?p=clubhouse';
$ch = curl_init();
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12;MEGAUPLOAD 1.0");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
$result = curl_exec($ch);
curl_close($ch);
$pattern = '(#Ligi Juniorskie(.*) dni zapisów#)';
$ile = preg_match_all($pattern, $result, $matches, PREG_PATTERN_ORDER);
for ($i=0; $i<count($ile); $i++) {
echo ($matches[0][$i]) . '<br>';
}