本文实例讲述了PHP简单处理表单输入的特殊字符的方法。分享给大家供大家参考,具体如下:
PHP;">
PHP
if ($_POST['submitted'] == "yes"){
$yourname = $_POST['yourname'];
$yourname = trim ($yourname);
$yourname = strip_tags ($yourname);
$yourname = htmlspecialchars ($yourname);
$yourname = addslashes ($yourname);
echo $yourname . "
"; ?>
"; ?>