From a753bdbafaffa91f6d8069f828f34488350482d5 Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Thu, 1 Dec 2022 20:55:57 +0800 Subject: [PATCH] NoDirectPhpAcess.php: logout user when he tries direct url access to a php file --- Admin.php | 2 +- NoDirectPhpAcess.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Admin.php b/Admin.php index 95fcc1f..564b4be 100644 --- a/Admin.php +++ b/Admin.php @@ -10,7 +10,7 @@ include 'Header.php'; diff --git a/NoDirectPhpAcess.php b/NoDirectPhpAcess.php index d5e6143..4e85779 100644 --- a/NoDirectPhpAcess.php +++ b/NoDirectPhpAcess.php @@ -2,6 +2,6 @@ // https://stackoverflow.com/questions/33999475/prevent-direct-url-access-to-php-file if (!isset($_SERVER['HTTP_REFERER']) ) { /* choose the appropriate page to redirect users */ - die( header( 'location: index.php' ) ); + die( header( 'location: logout.php' ) ); } ?>