简体   繁体   中英

How to convert Html code to template output in browser

I need to convert HTML in template. As seen in image content should show as a template. I am using table to show . but now i need to show it in template output

Here is my Code:

<table id="datatable" class="tablesorter"> 
    <span id='errfrmMsg'></span>
    <thead>
        <tr>        
            <th scope="col" id="">Name</th>
            <th scope="col" id="">Content</th>
        </tr>
    </thead>

    <tbody>
        <?php
            $templ_id = $_REQUEST['templ_id'];
            $getTemplateQuery = mysql_query("select * from templates where id = $templ_id");
            $getTemplateRow = mysql_fetch_array($getTemplateQuery);
        ?>
        <tr>
            <td valign="top" width="125"><?php echo $getTemplateRow['templ_name'];?></td>
            <td valign="top" width="319">
            <?php
                echo $templContent = $getTemplateRow['templ_content'];
?>
        </tr>
    </tbody>
</table>

Here is an Output:

在此处输入图片说明

From what I can gather from your question, try outputting with:

$html = htmlspecialchars_decode($content)

EDIT:

echo $templContent = htmlspecialchars_decode($getTemplateRow['templ_content']);

Try this this will help You

<?php

echo $htmlContent = htmlspecialchars_decode($getTemplateRow['templ_content']) 

?>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM