次の場合、「未定義のインデックス」を取得し続けます。
$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);