$error=array(); #定义错误为数组 if (empty($_POST['first_name'])){ $error[]='you forgot to enter you first name'; }else{ $fn= mysql_real_escape_string(trim($_POST['first_name']),$dbc); } #first name 条件语句
if (empty($_POST['last_name'])) { $error[]='you forgot to enter you last name'; }else{ $ln= mysql_real_escape_string(trim($_POST['last_name']),$dbc); } #last name 条件语句
if (empty($_POST['email'])){ $error[]='you forgot to enter you email'; }else{ $e= mysql_real_escape_string(trim($_POST['email']),$dbc); } # email 条件语句 if (!empty($_POST['password1'])) { if($_POST['password1']!=$_POST['password2']){ $error[]='your password did not match the confirmed password.'; }else{ $p= mysql_real_escape_string(trim($_POST['password1']),$dbc); } }else{ $error[]='you forgot to your password'; } # password 条件语句