我不断收到以下内容的“未定义索引”:
$username = $_POST['username'];
$email = $_POST['email'];
$email1 = "@";
$email_check = strpos($email,$email1);
$pwd = $_POST['pwd'];
$pwd_conf = $_POST['pwd_conf'];
$uLength = strlen($username);
$pLength = strlen($pwd);
我已经尝试过 if(isset()) 但错误只更改为“未定义变量”
if (isset($_POST['username'])) {
$username = $_POST['username'];
}
if (isset($_POST['email'])) {
$email = $_POST['email'];
}
$email1 = "@";
$email_check = strpos($email, $email1);
if (isset($_POST['pwd'])) {
$pwd = $_POST['pwd'];
}
if (isset($_POST['pwd_conf'])) {
$pwd_conf = $_POST['pwd_conf'];
}
$uLength = strlen($username);
$pLength = strlen($pwd);