<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://www.darkorbit.pl/big/?aid=3047&aip="); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_COOKIESESSION, 1); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7'); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0); curl_setopt($ch, CURLOPT_POSTFIELDS, "loginForm_default_username=****&loginForm_default_password=****&loginForm_default_login_submit=Logowanie&LPId=3578"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); $str = curl_exec($ch); curl_close($ch); $c = curl_init(); curl_setopt($c, CURLOPT_URL, $link); curl_setopt($c, CURLOPT_HEADER, 0); curl_setopt($c, CURLOPT_COOKIESESSION, 1); curl_setopt($c, CURLOPT_VERBOSE, 1); curl_setopt($c, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.0.7) Gecko/2009021910 Firefox/3.0.7'); curl_setopt($c, CURLOPT_FOLLOWLOCATION, 0); curl_setopt($c, CURLOPT_COOKIEFILE, 'cookie.txt'); curl_setopt($c, CURLOPT_RETURNTRANSFER, 1); $str2 = curl_exec($c); curl_close($c); ?>
Pierwsza część wykonuje się dobrze i otrzymuje żądaną stronę, jednak echo $str2 pokazuje tylko pustą stronę. Gdzie mam błąd?