我如何使用 PHP 或 Javascript 來檢查用戶的上一頁是否是我網站上的某個頁面,如果是,則顯示警告框?
1 回答

郎朗坤
TA貢獻1921條經驗 獲得超9個贊
如果一個人真的想要,這可以被規避。
//on the page for the alert
session_start();
if($_SESSION['lastPage']=='??'){
echo 'alert';
}
//on the page you want to detect if the user came from
session_start();
$_SESSION['lastPage']=$_SERVER['REQUEST_URI'];
- 1 回答
- 0 關注
- 173 瀏覽
添加回答
舉報
0/150
提交
取消