admin管理员组文章数量:1431720
How correct validate data from user to save in database from inputs?
I use this for textfields:
$name = trim(sanitize_text_field($_POST['name']));
But if i add special signs like "&*({} Something like this ^&({}<>", then they add without a problem.
I need add only "Something like this" without special signs.
How correct validate data from user to save in database from inputs?
I use this for textfields:
$name = trim(sanitize_text_field($_POST['name']));
But if i add special signs like "&*({} Something like this ^&({}<>", then they add without a problem.
I need add only "Something like this" without special signs.
Share Improve this question asked Apr 22, 2019 at 16:44 JaronJaron 458 bronze badges 1- 2 For reference, WordPress provides some guidance for validating and sanitizing user input: codex.wordpress/… – MikeNGarrett Commented Apr 22, 2019 at 16:49
1 Answer
Reset to default 3Try $name = trim( sanitize_user( $_POST['name'], true ) );
Be sure that the function does what you want! Read here
本文标签: pluginscorrect validate inputs
版权声明:本文标题:plugins - correct validate inputs 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745566366a2663783.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论