Jump to content

how to insert value


fareedreg

Recommended Posts

I am having file bookissueadd.php..... in which i am having tag

 

<td height="21">Issue Charges</td>

<td><div id="txtcharges"></b>

</div></td>

 

 

in another php file i am doing some calculation and get my value in variable $cal

 

getbookname.php

 

$cal = $bookprice/100*$perval; 

 

 

now my question is how can i put the value of $cal in front of html tag ISSUE CHARGES

 

thanks

 

Link to comment
https://forums.phpfreaks.com/topic/188017-how-to-insert-value/
Share on other sites

Yup. If you're still learning, than you can easily echo HTML or close the tags for php and insert the value manually like so:

<td height="21"><?php echo $cal; ?> Issue Charges</td>
<td><div id="txtcharges"></b>
</div></td>

 

Or you can simply define it within a string, where the HTML is supposed to show up:

echo '<td height="21">' . $cal; . '  Issue Charges</td>
<td><div id="txtcharges"></b>
</div></td>'; //echo HTML as a string with $cal.

 

Pass the values to the other page through include/sessions.

Link to comment
https://forums.phpfreaks.com/topic/188017-how-to-insert-value/#findComment-992623
Share on other sites

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.