好吧问题是,当我使用修剪功能不起作用,但当我运行没有修剪功能的代码工作,但没有正常工作(表单接受空格)
session_start();
unset($_SESSION['username']);
if (isset($_SESSION['username']))
{echo "You are in already";}
else if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
if (!empty(trim($_POST['username'])) && !empty(trim($_POST['email'])))
{
$uname = htmlentities($_POST['username']);
$email = htmlentities($_POST['email']);
$_SESSION['username'] = $uname;
echo "THANKS: " . $uname . "
";
}
else { echo "fill the goddemn field"; }
} else { ?>
USERNAME:
E-mail: