私はモーダルボックス内のフォームを使用してdbに値を挿入していますが、成功のポップアップを除いてすべて正常に動作します。
クエリが私の質問は、なぜ私の成功のウィンドウが来ていないですか?私は成功
<?php
if (isset($_POST['btn-signup'])) {
echo $success;
}
?>
をエコーのindex.phpに続いてfuntions.phpページに
//create account
if (isset($_POST['btn-signup'])){
$firstname = test_input($_POST['firstname']);
$email = filter_var($_POST['email'], FILTER_VALIDATE_EMAIL);
$pass = test_input($_POST['password']);
$cpass = test_input($_POST['confirm_password']);
if ($pass == $cpass){
$password = password_hash($pass, PASSWORD_DEFAULT);
$signupQuery = "INSERT INTO draadlozeAccount (firstname, email, pass) VALUES
('$firstname','$email','$password')";
$signupResult = $conn->query($signupQuery);
if (!$signupResult) {
echo $conn->error;
$conn->close();
} else {
$success = '<div class="notification pos-right pos-bottom col-sm-4 col-md-3" data-animation="from-bottom" data-notification-link="trigger">
<div class="boxed boxed--border border--round box-shadow">
<img alt="avatar" class="image--sm" src="img/logo.png" />
<div class="text-block">
<h5>Success</h5>
<p>
Your account has been created successfully. You will receive an email soon.
</p>
</div>
</div>
</div>';
}
}
}
を実行しますか何が欠けているのですか
仲間ありがとう、あなたの答えは私のコードを微調整したのに役立ちました。 –