Ik log in met een functie, en daar krijg ik netjes deze headers op terug:
Daar strip ik alleen de session id uit, en geef hem door aan m'n volgende functie :
Daarop krijg ik dit terug :
met de boodschap dat ik niet ingelogd ben, en dus niet de private fora's mag bekijken
Weet iemand wat ik fout doe en hoe ik het op kan lossen
code:
1
2
3
4
5
6
7
8
9
10
11
12
| HTTP/1.1 200 OK Date: Thu, 11 Oct 2001 10:31:14 GMT Server: Apache/1.3.19 (Unix) PHP/4.0.6 X-Powered-By: PHP/4.0.6 Expires: Mon, 26 Jul 1997 05:00:00 GMT Last-Modified: Thu, 11 Oct 2001 10:31:14 GMT Cache-Control: no-cache, must-revalidate Pragma: no-cache Set-Cookie: user=0; domain=gathering.tweakers.net; path=/; expires=-1 Set-Cookie: sessid=bde21a00556300221993842c681d83c1; domain=gathering.tweakers.net; path=/; expires=Friday, 11-Oct-2002 12:31:14 GMT Connection: close Content-Type: text/html |
Daar strip ik alleen de session id uit, en geef hem door aan m'n volgende functie :
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
| <? function ReadGoTpage($page, $cookie, $userid) { $contentlength = 100+ strlen($cookie) + strlen("$userid"); $sendstring = "GET http://gathering.tweakers.net/$page HTTP/1.0\n"; $sendstring .= "Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/msword, application/vnd.ms-excel, application/vnd.ms-powerpoint, */*\n"; $sendstring .= "Accept-Language: en-us\n"; $sendstring .= "Accept-Encoding: gzip, deflate\n"; $sendstring .= "User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt)\n"; $sendstring .= "Host: gathering.tweakers.net\n"; $sendstring .= "Content-Length: $contentlength\n"; $sendstring .= "Connection: Keep-Alive\n"; $sendstring .= "Cookie: user=".$userid."; domain=gathering.tweakers.net; path=/; expires=-1\n"; $sendstring .= "Cookie: ".$cookie."\n\n"; $result = GOT_connect($sendstring); // GOT_connect is een simpele fsockopen functie. return $result; } ?> |
Daarop krijg ik dit terug :
code:
1
2
3
4
5
6
7
8
9
10
11
12
| HTTP/1.1 200 OK Date: Thu, 11 Oct 2001 10:27:00 GMT Server: Apache/1.3.19 (Unix) PHP/4.0.6 X-Powered-By: PHP/4.0.6 Set-Cookie: user=0; domain=gathering.tweakers.net; path=/; expires=-1 Set-Cookie: sessid=10219a7092b09020fd8a510af1b707c1; domain=gathering.tweakers.net; path=/; expires=Friday, 11-Oct-2002 12:27:00 GMT Expires: Mon, 26 Jul 1997 05:00:00 GMT Last-Modified: Thu, 11 Oct 2001 10:27:00 GMT Cache-Control: no-cache, must-revalidate Pragma: no-cache Connection: close Content-Type: text/html |
met de boodschap dat ik niet ingelogd ben, en dus niet de private fora's mag bekijken
Weet iemand wat ik fout doe en hoe ik het op kan lossen