当我尝试为现有电子邮件注册echo json命令时,出现此错误
使用未定义的常量Email_Error-在第16行的C:\ xamppnew \ htdocs \ android \ signup.php中假定为'Email_Error'(这将在PHP的未来版本中引发错误) {“ SIGNUP”:“ Email_Error”}
当没有错误时,我会收到此错误
注意:未定义的变量:第23行的C:\ xamppnew \ htdocs \ android \ signup.php中的arr 空
php代码
<?php
include "conn.php";
$Fname = $_POST['Fname'];
$Lname = $_POST['Lname'];
$Email = $_POST['Email'];
$Password = $_POST['Password'];
$sql_verify = "SELECT * FROM users WHERE Email = :EMAIL";
$stmt = $PDO->prepare($sql_verify);
$stmt->bindParam(':EMAIL', $Email);
$stmt->execute();
if ($stmt->rowCount() > 0) {
$arr = array( 'SIGNUP' => Email_Error);
}else{
echo "Signup compelete";
}
echo json_encode($arr);
?>
请注意我遵循json的php手册