Co jest nie tak?
kod z mojej strony:
Kod
GET /~torki/pl3.php HTTP/1.1
Host: 127.0.0.1
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: pl
Cookie: PHPSESSID=3fd0ced5ef3e1a9c74292ffe4871349a; __utma=96992031.887802130.1449842263.1449855006.1449915689.4; __utmb=96992031.4.10.1449915689; __utmc=96992031; __utmz=96992031.1449842263.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36
HTTP/1.1 200 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: Keep-Alive
Content-Encoding: gzip
Content-Length: 8675
Content-Type: text/html; charset=utf8
Date: Sat, 12 Dec 2015 10:37:37 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive: timeout=15, max=100
Pragma: no-cache
Server: Apache/1.3.31 (Win32) PHP/5.2.17 mod_gzip/1.3.26.1a
X-Powered-By: PHP/5.2.17
kody jakie są wysylane ze strony na której ma byc logowanie:
Login:
Kod
POST /login.php HTTP/1.1
Host: stronawww.pl
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: pl
Content-Type: application/x-www-form-urlencoded
Cookie: lasttorrentcomment=1449783486; __utmt=1; __utma=238801941.418801519.1448467245.1449912670.1449916844.12; __utmb=238801941.1.10.1449916844; __utmc=238801941; __utmz=238801941.1449855391.10.3.utmcsr=127.0.0.1|utmccn=(referral)|utmcmd=referral|utmcct=/~torki/pl3.php
Origin: http://stronawww.pl
Referer: http://stronawww.pl/
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36
HTTP/1.1 200 OK
Accept-Ranges: bytes
Age: 0
Connection: keep-alive
Content-Encoding: gzip
Content-Length: 139
Content-Type: text/html
Date: Sat, 12 Dec 2015 10:38:07 GMT
Server: Apache
Set-Cookie: hashx=9c17784ffdb13725ec42fa1e1e653da2; expires=Tue, 19-Jan-2038 03:14:07 GMT; path=/
Set-Cookie: pass=8813b538898d56361472d9c92a987efb; expires=Tue, 19-Jan-2038 03:14:07 GMT; path=/
Set-Cookie: uid=121718; expires=Tue, 19-Jan-2038 03:14:07 GMT; path=/
Vary: Accept-Encoding,User-Agent
Via: 1.1 varnish
X-Powered-By: PHP/5.3.28
X-Varnish: 411451199
index:
Kod
GET /index.php HTTP/1.1
Host: stronawww.pl
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch
Accept-Language: pl
Cookie: lasttorrentcomment=1449783486; __utmt=1; __utma=238801941.418801519.1448467245.1449912670.1449916844.12; __utmb=238801941.1.10.1449916844; __utmc=238801941; __utmz=238801941.1449855391.10.3.utmcsr=127.0.0.1|utmccn=(referral)|utmcmd=referral|utmcct=/~torki/pl3.php; uid=121718; pass=8813b538898d56361472d9c92a987efb; hashx=9c17784ffdb13725ec42fa1e1e653da2
Referer: http://stronawww.pl/login.php
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.80 Safari/537.36
HTTP/1.1 200 OK
Accept-Ranges: bytes
Age: 0
Connection: keep-alive
Content-Encoding: gzip
Content-Length: 6405
Content-Type: text/html; charset=ISO-8859-2
Date: Sat, 12 Dec 2015 10:38:07 GMT
Server: Apache
Vary: Accept-Encoding,User-Agent
Via: 1.1 varnish
X-Powered-By: PHP/5.3.28
X-Varnish: 411451208
Dobra, sam doszedłem do rozwiązania - zrobiłem cookie z wszystkimi danymi i przeszło - jak ktoś szuka to tak recznie zrobić ciastko w curl (znalezione na PHP.PL)
<?
$ch = curl_init('http://localhost/curl/site.php');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_COOKIE, $cookie);
?>