3 function spu_process_info($stream_info, &$header, &$get, &$post)
9 foreach(preg_split("/(\r?\n)/", $stream_info) as $line) {
10 // printf("LINE: [%s]\n", $line);
12 if (!isset($header['The-Request'])) {
15 $req = explode(" ", $header['The-Request']);
17 // GET params management
18 $get_vars = explode('?', $req[1], 2);
19 if (count($get_vars) > 1) {
20 $a = explode('&', $get_vars[1]);
21 printf("A COUNT: [%s] %d\n", $a[0], count($a));
22 for ($i = 0 ; $i < count($a) ; $i++) {
23 $b = explode('=', $a[$i]);
24 $get[$b[0]] = urldecode($b[1]);
27 // POST params management
28 if ($req[0] == 'POST') {
29 if ($header['Content-Type'] != 'application/x-www-form-urlencoded'
30 || !isset($header['Content-Length'])) {
33 $post_len = mb_strlen($line, "latin1");
34 $a = explode('&', $line);
35 for ($i = 0 ; $i < count($a) ; $i++) {
36 $b = explode('=', $a[$i]);
37 $post[$b[0]] = urldecode($b[1]);
39 printf("INFO: postlen: %d\n", $post_len);
47 $split = explode(":", $line, 2);
48 $header[$split[0]] = $split[1];