Jump to content

[SOLVED] Making PHP code within HTML


dragunu

Recommended Posts

Hello all,

how is it possible to if

[code]
$number = 80 ;
[/code]

then how can i possibly embed it in like <td align=enter><span class=style1>Number Found </span></td> ;

i tried using htmlentities however, when i used it, the whole code in HTML code was printed out not the formatted html text.

thanks again ,

dragunu
Link to comment
https://forums.phpfreaks.com/topic/32385-solved-making-php-code-within-html/
Share on other sites

If you're within the <?php ?> tags:
[code]<?php
echo '<td align=enter><span class=style1>Number Found ' . $number . '</span></td>';
?>[/code]

If you're not within the <?php ?> tags:
[code]
<td align=enter><span class=style1>Number Found <?php echo $number ?></span></td>
[/code]

Ken

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.