2017-10-10 91 views
-6

5學嘗試我想告訴用戶試圖驗證碼後,e.g 3次,以防止攻擊到我的網站。這很容易表現出像die('your attempts are 3')消息或一些像這樣的事情。我的問題是如何在php中3次嘗試後顯示recaptcha。顯示驗證碼在PHP

<?php 
    $attempt = isset($_SESSION['attempt'])? $_SESSION['attempt']: 0; 
    if($attempt == 3){ 
    //show recaptcha with jquery 
    } 
?> 

回答

0

請試試這個,

<?php 
$attempt = isset($_SESSION['attempt'])? $_SESSION['attempt']: 0; 
if($attempt >= 3){ 
     //show recaptcha with jquery 
} 
?>