사용자가 확인 링크를 클릭하면 계정 확인 프로세스가 진행됩니다. 그/그녀는 즉시 대시 보드로 리디렉션합니다. 그러나 몇 초 동안 계정이 확인되었다는 확인 메시지를 보내고 싶습니다. 여기 내 코드php에서 지연을 추가하는 방법
<?PHP
require_once 'include/Functions.php';
$db = new DB_Functions();
if(isset($_GET['username'])&&isset($_GET['q']))
{
$username= $_GET['username'];
$hash= $_GET['q'];
$salt = "498#2D83B631%3800EBD!801600D*7E3CC13";
$resetkey = hash('sha512', $salt.$username);
if($hash==$resetkey){
$user = $db->activateAccount($username);
if ($user != false) {
// user is found
echo '<script>';
echo 'document.getElementById("result_status").innerHTML = "<strong>Congratulations! Your Account has been verified .</strong>"';
echo '</script>';
$passwords=$db->getPasswordFromUsername($username);
$users = $db->loginUserWithMdfPassword($username, $passwords);
if ($users != false) {
// password is found
$properlyLogged=true;
if($properlyLogged) {
// season for storing data start here
session_start();
$_SESSION['username']=$username;
header('Location: http://localhost/mywebsite/dashboard.php');
exit();
// season for storing data end here
}}
}
}else {
echo '<script>';
echo 'document.getElementById("result_status").innerHTML = "<strong>Session has been expired.</strong>"';
echo '</script>';
}}
?>
와 자바 스크립트를 사용하여 리디렉션을 미리 형성 할 것이다 : 나는 그것을 사용하는 방법을 http://php.net/manual/en/function.sleep.php –
내 코드? 말해 줄 수있어? –