我需要一个在错误时保留其值的表单,但要确保输入数据是干净的安全明智的。
<form action="" method="POST">
<div>
<label for="first_name">First Name</label>
<input type="text" name="first_name" value="$_POST['first_name']"/>
</div>
</form>
我应该如何处理 $_POST['first_name'] 以使其安全且不易受到攻击?