Mam taki formularz (wrzuciłem go na pasterbin.com):
Próbowałem połączyć się tak:
$ch = curl_init('http://www.strona.com/index.php?act=download#dloadform');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_NOBODY, false);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, 'links=http://rapidshare.com/files/389251039/Perfect_-_Niewiele_Ci_Moge_Dac.mp3&downloadit=Generate Links');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12');
$afterLogin = curl_exec($ch);
echo $afterLogin;
curl_close($ch);
Ale chyba coś nie wysyła danych...
Jak to zrobić?
Edit// Może to pomoże..?
POST /index.php?act=download HTTP/1.1
Host: strona.com
Connection: keep-alive
Referer: [url="http://stronay.com/index.php?act=download"]http://stronay.com/index.php?act=download[/url]
Content-Length: 402
Cache-Control: max-age=0
Origin: [url="http://strona.com"]http://strona.com[/url]
If-Modified-Since: Sat, 1 Jan 2000 00:00:00 GMT
content-type: application/x-www-form-urlencoded
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10
Accept-Encoding: gzip,deflate,sdch
Accept-Language: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4
Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.3
Cookie: PHPSESSID=e458490805ec0ee9a78d1971d56dddca; lseSavePass=YToyOntzOjU6InVuYW1lIjtzOjY6IjExMTQxMyI7czo4OiJwYXNzd29yZCI7czo4OiJhUzQ1UkZzMiI7fQ%3D%3D
xjxfun=makeLinks&xjxr=1293632596645&xjxargs[]=%3Cxjxobj%3E%3Ce%3E%3Ck%3Elinks%3C%2Fk%3E%3Cv%3ES%3C!%5BCDATA%5Bhttp%3A%2F%2Frapidshare.com%2Ffiles%2F389251039%2FPerfect_-_Niewiele_Ci_Moge_Dac.mp3%5D%5D%3E%3C%2Fv%3E%3C%2Fe%3E%3Ce%3E%3Ck%3Edownloadit%3C%2Fk%3E%3Cv%3ES%3C!%5BCDATA%5BGenerate%20Links%5D%5D%3E%3C%2Fv%3E%3C%2Fe%3E%3Ce%3E%3Ck%3Ereset%3C%2Fk%3E%3Cv%3ESReset%3C%2Fv%3E%3C%2Fe%3E%3C%2Fxjxobj%3EPOST /index.php?act=download HTTP/1.1
Host: strona.com
Connection: keep-alive
Referer: [url="http://strona.com/index.php?act=download"]http://strona.com/index.php?act=download[/url]
Content-Length: 199
Cache-Control: max-age=0
Origin: [url="http://strona.com"]http://strona.com[/url]
If-Modified-Since: Sat, 1 Jan 2000 00:00:00 GMT
content-type: application/x-www-form-urlencoded
Accept: */*
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10
Accept-Encoding: gzip,deflate,sdch
Accept-Language: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4
Accept-Charset: ISO-8859-2,utf-8;q=0.7,*;q=0.3
Cookie: PHPSESSID=e458490805ec0ee9a78d1971d56dddca; lseSavePass=YToyOntzOjU6InVuYW1lIjtzOjY6IjExMTQxMyI7czo4OiJwYXNzd29yZCI7czo4OiJhUzQ1UkZzMiI7fQ%3D%3D
xjxfun=processLink&xjxr=1293632598135&xjxargs[]=S%3C!%5BCDATA%5Bhttp%3A%2F%2Frapidshare.com%2Ffiles%2F389251039%2FPerfect_-_Niewiele_Ci_Moge_Dac.mp3%5D%5D%3E&xjxargs[]=Srapidshare.com&xjxargs[]=Strue