salut,

est ce que quelqu'un à une idée précise sur la manière dont fonctionne get_headers() quand il reçoit le code 301 et/ou 300/307 (ceux qui me pose encore des problemes) ?

ps : j'ai déjà été dans les sources du moteur PHP (url.c) mais il n'y a rien de visible suivant le statut renvoyé par le serveur ..

merci


----
exemple :
si je vise l'url http://httpd.apache.org//docs/2.2/fr/de avec ma classe qui permet de recup les header + html (en utilisant les sockets), voici ce que j'ai dans le tableau des headers :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
 
'tbHeader' -> Array(8) 
[0] => (chaine)(30) HTTP/1.1 301 Moved Permanently
[1] => (chaine)(35) Date: Sat, 21 Feb 2009 00:22:48 GMT
[2] => (chaine)(27) Server: Apache/2.2.9 (Unix)
[3] => (chaine)(45) Location: http://httpd.apache.org/docs/2.2/de
[4] => (chaine)(21) Vary: Accept-Encoding
[5] => (chaine)(19) Content-Length: 322
[6] => (chaine)(17) Connection: close
[7] => (chaine)(43) Content-Type: text/html; charset=iso-8859-1
par contre si j'utilise get_headers() sur la meme URL, j'ai ca :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
 
Array(30) 
[0] => (chaine)(30) HTTP/1.1 301 Moved Permanently
[1] => (chaine)(35) Date: Sat, 21 Feb 2009 00:22:48 GMT
[2] => (chaine)(27) Server: Apache/2.2.9 (Unix)
[3] => (chaine)(45) Location: http://httpd.apache.org/docs/2.2/de
[4] => (chaine)(21) Vary: Accept-Encoding
[5] => (chaine)(19) Content-Length: 322
[6] => (chaine)(17) Connection: close
[7] => (chaine)(43) Content-Type: text/html; charset=iso-8859-1
[8] => (chaine)(30) HTTP/1.1 301 Moved Permanently
[9] => (chaine)(35) Date: Sat, 21 Feb 2009 00:22:48 GMT
[10] => (chaine)(27) Server: Apache/2.2.9 (Unix)
[11] => (chaine)(46) Location: http://httpd.apache.org/docs/2.2/de/
[12] => (chaine)(21) Vary: Accept-Encoding
[13] => (chaine)(19) Content-Length: 323
[14] => (chaine)(17) Connection: close
[15] => (chaine)(43) Content-Type: text/html; charset=iso-8859-1
[16] => (chaine)(15) HTTP/1.1 200 OK
[17] => (chaine)(35) Date: Sat, 21 Feb 2009 00:22:49 GMT
[18] => (chaine)(27) Server: Apache/2.2.9 (Unix)
[19] => (chaine)(31) Content-Location: index.html.de
[20] => (chaine)(62) Vary: negotiate,accept-language,accept-charset,Accept-Encoding
[21] => (chaine)(11) TCN: choice
[22] => (chaine)(44) Last-Modified: Tue, 06 Jan 2009 21:41:23 GMT
[23] => (chaine)(58) ETag: "52d112-1f35-45fd744c1c6c0;291c98-2d5-44c90fb99b9c0"
[24] => (chaine)(20) Accept-Ranges: bytes
[25] => (chaine)(20) Content-Length: 7989
[26] => (chaine)(17) Connection: close
[27] => (chaine)(23) Content-Type: text/html
[28] => (chaine)(20) Content-Language: de
[29] => (chaine)(38) Expires: Sat, 21 Feb 2009 00:22:49 GMT