[英]display pop up div html before redirect to another page
我在插入語法后使用重定向來防止在php中重復插入
這是我的PHP代碼:
if (mysqli_num_rows($result_email) > 0)
{
$emailerror = true; //display pop up working properly
}
else
{
//insert sql syntax
$emailerror = false;
header('Location: index.php');
}
插入sql語法有效,但刷新頁面時插入會翻倍,這就是為什么我添加標題位置來防止它的原因。 但是我想在注冊后顯示彈出式注冊成功並重定向到另一個頁面
這是我的簡短HTML代碼:
<?php
if ($emailerror == true)
{
echo "<div class='popup_email_error'> </div>";
}
else if($emailerror == false)
{
echo "<div class='popup_register'> </div>";
}
?> // this code is working properly without header location syntax but the problem is the insertion sql is always doubled
我想先彈出然后再重定向到另一頁,反之亦然如何防止沒有標題位置的兩次插入
我已經嘗試過javascript重定向工程,但是語法的插入是雙重的
您可以使用Flash包將其發送到視圖。 每次調用(包括重定向)都會將其存儲在$_SESSION
變量中。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.