d22552000 Posted September 9, 2007 Share Posted September 9, 2007 <?PHP /*CODE SNIPPED*/ $input = socket_read($spawn, 1024) or die("Could not read input\n"); $input = trim($input); $request = split("[\n\r\t]+", $input); $header = split("[ ]+", $request); if (strlen($header[1])==1) { $errmsg="No File Requested"; } foreach ($request as $value) { $totalvar .="\t".$value; } $done=0; $l=0; $requested = split("[ ]+", $input); foreach($requested as $r) { while($done==0) { print "\t".$r[$l]; print $l; if ($r[$l]=="Host:") { $l++; $remote_addr=$r[$l]; $done++; } if ($l==50) { break; break; break; } $l++; } } print "\n".gmdate("[d-m-y_j:i:s]")." User: ".$remote_addr." Requested: ".$header[1]; if (!empty($errmsg)) { print $errmsg."\n"; } } /*CODE SNIPPED*/ ?> The output is: G0 E1 T2 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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 50 [09-09-07_9:12:31] User: Requested: (I only have it showing all the numbers as a test for debug) So why does it only have get left in input, did I mortalize it or something? Quote Link to comment Share on other sites More sharing options...
d22552000 Posted September 9, 2007 Author Share Posted September 9, 2007 cmon ppl. Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 9, 2007 Share Posted September 9, 2007 You complained about no one helping. You need to learn how to ask a question. "So why does it only have get left in input, did I mortalize it or something?" This makes no freaking sense. You have not told us what the code is supposed to do, what the expected output is, any errors you get, etc. You just posted code, numbers and a nonsensical question. Quote Link to comment Share on other sites More sharing options...
Jessica Posted September 10, 2007 Share Posted September 10, 2007 And you also need to read the forum guidelines, and NOT PM someone with a question just because they posted on your thread. Your PM did not contain ANY of the things I said were missing from your post. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.