Jump to content

random error when trying to acess variables in a string


d22552000

Recommended Posts

<?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?

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.