variable in textarea template code closing textarea tag
I have in my control panel ( HTML template editor )
<?
$textarea = '<textarea>';
$textarea .= $template_code;
$textarea .= '</textarea>';
echo $textarea;
?>
The variable $template_code contains html, including </textarea>
for example -> $template_code = '</textarea> ......';
This means the variable will close my textarea and other code will be outside my real textarea!!
How i can avoid this?
use htmlentities to escape the special characters.
echo '<textarea>'.htmlentities($template_code).'</textarea>';
加载中,请稍侯......
精彩评论