Jump to content

[SOLVED] HTML output problem


wsantos

Recommended Posts

It seems I got myself in the situation and could use some help

 

  for($row=0;$row<count($GCode);$row++)
  {
?>
    <TR>
      <TD><?php echo $GCode[$row]; ?></TD>
      <TD><?php echo $GCodeList[$GCode[$row]][0]; ?></TD>
      <TD><?php echo $GCodeList[$GCode[$row]][1]; ?></TD>
      <TD><?php echo $GCodeList[$GCode[$row]][2]; ?></TD>
      <TD><?php echo $GCodeList[$GCode[$row]][3]; ?></TD>
    </TR>
<?php

 

i already checked the value of the data before and after the for loop and got it correctly via linux.however on web browser this section is totally blank...thanks for the help

Link to comment
Share on other sites

Kind of hard to determine wihtout knowing the contents of $GCodeList and $GCode. Can you show the out put of:

 

echo "<pre>";
print_r($GCodeList);
print_r($GCode);
echo "</pre)";

 

Also, your code assumes that the keys of $GCode are numeric, which they may be. Also, you can create a loop for the $GCodeList values as well. Try this;

 

<?php

foreach ($GCodeList as $GCodeKey => $GCodeValue)  {

  echo "<TR>\n";
  echo "    <TD>$GCodeKey</TD>\n";

  foreach ($GCodeValue as $value) {
    echo "    <TD> $value</TD>\n";
  }

  echo "</TR>\n";
}

?>

Link to comment
Share on other sites

$GCodeList

  - key = > element1

                element2

                .

                .

                $GCode

                .

                .

                elementn

 

 

$GCode

  - nkey => val

                stat1

                stat2

                .

                .

                .

 

i can assure you that both arrays are properly populated. even my linux output is correct.which has the form

 

<TABLE>
  <TR>
     <TD>value of gcode[0]</TD>
     <TD>value of gcodelist[gcode[0][0]</TD>
     <TD>value of gcodelist[gcode[0][1]</TD>
     <TD>value of gcodelist[gcode[0][n]</TD>
  </TR>
  <TR>
     <TD>value of gcode[1]</TD>
     <TD>value of gcodelist[gcode[1][0]</TD>
     <TD>value of gcodelist[gcode[1][1]</TD>
     <TD>value of gcodelist[gcode[1][n]</TD>
  </TR>
  <TR>
     <TD>value of gcode[x]</TD>
     <TD>value of gcodelist[gcode[x][0]</TD>
     <TD>value of gcodelist[gcode[x][1]</TD>
     <TD>value of gcodelist[gcode[x][n]</TD>
  </TR>
</TABLE>

 

to make things more complicated the logs doesn't register any error too...:(

Link to comment
Share on other sites

None of what you just posted is useful in determining the problem.

 

Are you saying that $GCodeList has a key called 'key' and that the elements of the array are 'element1', 'element2', etc? Real data was what I was interested in.

 

I'm not sure how to interpret your sample HTML output. Are you saying that the actual output has the actual text "gcodelist[gcode[x][0]"?

 

Lastly, I have no idea what you mean by "my linux output is correct". Are you saying that it works correctly on a Linux server or the client is Linux?

Link to comment
Share on other sites

runs under linux server run the client using telnet...

 

sorry can't VPN to the server this weekend. so have to do this manually. by the way heres one row of the output

 

  <TR>
    <TD>GX192</TD>
    <TD>15</TD>
    <TD>SIP/10.20.63.4</TD>
    <TD>10</TD>
  </TR>

 

GX192 is the key for GCodeList,GCode contains the GX192 as the first element and the rest as follows...the key for GCode is numeric.

 

Link to comment
Share on other sites

Ok, so you get output when running a browser on the server, but not through the internet! Well, then the problem is most likely that there is a problem with hitting that server over the internet and this may not be a PHP problem at all. Can you hit any pages on that server over the internet?

 

I think I'm still a little confused over the exact problem here.

Link to comment
Share on other sites

i am confused myself...your code works with the my desired output as well...ok i'll try to explain it a little better...

 

1...server = linux, remote

2...client # 1 = telnet with right output

3...clent # 2 = Internet Explorer output blank

4...client # 2 = when the output is just a single line and not the array ... the output is correct

 

 

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.