Jump to content

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

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.