我使用模式框中的窗體將值插入到數據庫中,除彈出成功外,它都可以正常工作。
查詢獲取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>';
}
}
}
然後在index.php文件上運行我回聲出成功
<?php
if (isset($_POST['btn-signup'])) {
echo $success;
}
?>
我的問題是,爲什麼不來了我成功的窗口?我在想什麼
謝謝你的隊友,你的答案幫助我們調整了我的代碼,它現在都在工作。 –