Jump to content

all script in one variable! possible?


freaker87

Recommended Posts

I have this script and i want to take this in one variable & print where i want is this possible

if ($nro > 0) 
{ 

     echo "<table id='gridview' align='center'>
        <tr>
        <td bgcolor='#99CC00'>E.T.D.</td>
        <td bgcolor='#99CC00'>E.T.A.</td>
        <td bgcolor='#99CC00'>Quantity</td>
        </tr>";
        
        
    $totqty=0;     
    while ($row=mysql_fetch_array($result))
         {
            
            $etd = $row['etd'];                                                       
            $etd = GetDateUserFormat($etd);
            
            $eta = $row['eta'];
            $eta = GetDateUserFormat($eta);
            
            $qty = $row['shptqty'];

             
             
             
          echo "<tr>";
          echo "<td>" . $etd . "</td>";
          echo "<td>" . $eta . "</td>";
          echo "<td>" . $qty . "</td>";
          echo "</tr>";
          
          $totqty = $totqty + $qty;
         }
         
         $remqty = $styleqty - $totqty;
         
          echo "<br>";  
          echo "<tr>";
          echo "<td bgcolor='#99CC00' colspan='2'> Total Entered Quantity</td>";
          echo "<td>" . $totqty . " Kg.</td>";
          echo "<td bgcolor='#99CC00'> Remaining Quantity</td>";
          echo "<td>" . $remqty . " Kg.</td>";
          echo "</tr>";
        
          echo "</table>";

}

Link to comment
https://forums.phpfreaks.com/topic/255132-all-script-in-one-variable-possible/
Share on other sites

If you want, you could use file_get_contents and a relative url, not a remote url..

 

for example..

 

$content = file_get_contents('../code_repository/gridview.php');

 

and then $content will contain the content of the php file...

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.