-1

我改變了我的默認時區在我的php.ini從歐洲/柏林到另一個時區,突然我的登錄節流鎖定倒計時倒計時顯示剩餘的15分鐘秒但它正在計數而不是倒計時,請幫我修復它。更改默認時區搞砸倒計時

規範限制:

<?php 
$throttle = array(1 => 1, 10 => 2, 1000 => 'captcha'); 
$getfailedq = 'SELECT MAX(attempted) AS attempted FROM failed_logins'; 
$getfailed = $muc->prepare($getfailedq); 
$getfailed->bindParam(1, $attempted); 
$getfailed->execute(); 
if ($getfailed->rowCount() > 0) { 
    $row = $getfailed->fetch(PDO::FETCH_ASSOC); 
    $latest_attempt = (int) date('U', strtotime($row['attempted'])); 
    $getfailedq = 'SELECT Count(*) AS failed FROM failed_logins WHERE attempted > Date_sub(Now(), INTERVAL 15 minute)'; 
    $getfailed = $muc->prepare($getfailedq); 
    $getfailed->bindParam(1, $attempted); 
    $getfailed->execute(); 
    if ($getfailed->rowCount() > 0) { 
     $row = $getfailed->fetch(PDO::FETCH_ASSOC); 
     $failed_attempts = (int) $row['failed']; 
     krsort($throttle); 
     foreach ($throttle as $attempts => $delay) { 
      if ($failed_attempts > $attempts) { 
       if (is_numeric($delay)) { 
        $remaining_delay = time() - $latest_attempt + $delay; 
        echo 'You must wait ' . $remaining_delay . ' seconds before your next login attempt'; 
       } else { 
        echo "captcha"; 
       } 
       break; 
      } 
     }   
    } 
} 
?> 
+0

-1 「告訴我德codez」。請閱讀[我如何問一個好問題?](http://stackoverflow.com/help/how-to-ask)並提供[最小,完整和可驗證的示例](http://stackoverflow.com/幫助/ mcve) –

+0

你可以提出一個頭,而不是一個投票我是新來的,而不是專家,你期望什麼? – Serjio

+1

這是downvoting的正當理由。如果您編輯問題以符合網站指南,我很樂意反轉我的投票。據預期,請訪問[幫助中心](http://stackoverflow.com/help)。參觀之前,請先詳細瞭解網站的工作方式。謝謝。 –

回答

0

也許你的數據庫仍處於歐洲/柏林。

嘗試編輯你my.cnf文件,添加此

default_time_zone=TIMEZONE

+0

我沒有一個名爲my.cnf的文件,沒有我的時區不在歐洲,我重新啓動xampp,但沒有區別 – Serjio

+0

my.cnf是mysql的配置。你可以檢查你的數據庫時區是什麼?:'SELECT @@ global.time_zone,@@ session.time_zone;'你應該看到** SYSTEM **。 –