$submit=$_POST['submit'];
$fullname=$_POST['fullname'];
$phone=preg_replace('/[^0-9]/', '', $_POST['phone']);
$phone = (int) $phone;
$adress=$_POST['city'] . ' ' . $_POST['district'] . ' ' . $_POST['adress'];
$friends=$_POST['friends'];
$school=$_POST['school'];
$info=$_POST['info'];
$dob = $_POST['year']."-". $_POST['month']."-".$_POST['day'];
最近我添加到我的页面:
foreach ($_POST as $key => $value) {
$_POST[$key] = mysql_real_escape_string($value);
}
我想在添加到我的页面之前清理所有 $_POST ( http://prntscr.com/22uot ) ID 20 mysql_real_escape_string()
,之后是 id 22。我的页面将所有变量放入 db 表的字段中,但是当我想添加mysql_real_escape_string()
到变量时,它不会在字段中放入任何内容。我不知道该怎么办。