-4
這裏我有一段PHP代碼來拒絕訪問一個頁面,除非你來自兩個頁面(第1頁和第2頁)。但它不工作,因爲它根本不運行代碼。這裏有什麼問題?爲什麼PHP或它不工作?
if($_SERVER['HTTP_REFERER'] != 'http://www.example.com/access.html' or $_SERVER['HTTP_REFERER'] != 'http://example.com/php/upload.php'){
header ('Location: http://example.com/php/retry.php');
exit;
}
非常感謝。
提醒的是'$ _ SERVER [ 'HTTP_REFERER']'[真的不能被信任(http://php.net/manual/en/reserved.variables.server.php)! – someOne