gpt4 book ai didi

php - 用户可以在他们的个人资料描述中使用 html、css、javascript、php 等

转载 作者:太空宇宙 更新时间:2023-11-03 11:32:45 24 4
gpt4 key购买 nike

<分区>

因此,在我的网站上,我为用户提供了一个字段,他们可以在其中设置最多 100 个字母的个人资料描述。我的问题是他们可以使用 html 作为他们的个人资料描述!我使用 a 作为他们描述的输入,并直接放入 mysql 数据库中。

这是显示他们个人资料描述的代码

<div id="mid-profile-desc">
<p><?php echo $userProfileDesc;?></p>
</div>

<!--String is just this from database: $userProfileDesc = $row["profiledesc"];-->

但是对于这些用户,在设置他们的个人资料描述时,他们可以使用 html、css、javascript、php 等语言。他们还可以控制我的数据库。

那么我怎样才能禁止用户使用所有这些呢?我可能只是禁止“<”和“>”字母,但这可能也不安全。有什么好的方法既安全又安全吗?

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com