eval should work, too, just use ?> to leave php mode for plain html
output.
So if you have html and php, use this:
---
$code =
'?><td width="237"><span class="stylebody"><?php echo $html-
>checkbox("User/news"); ?> (Tick for yes)</span></td>';
eval($code);
---
Note the initial ?> to quit the initial php block which eval assumes.
However, as United mentioned, be careful to provide this functionality
for obvious security reasons.
Best,
JP
On 30 Jan., 08:10, Unite <[EMAIL PROTECTED]> wrote:
> Hey, was wondering if anyone can help me.
> I have code from a database that uses mixed PHP and HTML. When I try
> to output it (echo) it doesnt display the page correctly as theres a
> echo within the DB code.
>
> Example
> Saved in DB :
> <td width="237"><span class="stylebody"><?php echo $html-
>
> >checkbox("User/news"); ?> (Tick for yes)</span></td>
>
> Output on screen:
> Recieve Specials and Discount Alerts : checkbox("User/news"); ?>
> (Tick for yes)
>
> Saved on webpage:
> <?php echo pack("H*",$content);?> //saved in Hex in the DB
>
> So basically I want it to display the check box instead of
> checkbox("User/news"); ?>
>
> Any help much appreciated
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---