Adding mysql_real_escape_string() causes blank values to be stored to database
问题 $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']; Recently i added to my page: foreach ($_POST as $key => $value) { $_POST[$key] = mysql_real_escape_string($value); } i want to sanitize all $_POST's