ppowell777 Posted 2 hours ago Share Posted 2 hours ago I am getting an Illegal Redirection error trying to redirect to an absolutely valid URL. I can't seem to fix this problem, and I know that there is no whitespace causing this issue to fail. <?php if (!array_key_exists('token', $_SESSION) || !isset($_POST['token']) || is_null($_POST['token']) || $_SESSION['token'] !== $_POST['token']) { $msg = ERROR_MESSAGE . ' tokencheck.php ' . date('Y-m-d H:i:s') . ' Illegal redirection from "' . $_SERVER['HTTP_REFERER'] . '"'; toLogDB($msg); error_log($msg); header('Location: ' . ERROR_FULL_URL); die(); } ?> <?php ini_set('session.gc_maxlifetime', 60 * 10); session_start(); require('./globals/constants.php'); require('./globals/functions.php'); require('./globals/crypto.php'); require('./feedback/includes/constants.php'); require('./feedback/includes/globals.php'); require('./feedback/includes/functions.php'); require('./feedback/includes/delivery.php'); require('./feedback/includes/validation.php'); require('./feedback/includes/tokencheck.php'); // REST OF THE CODE ?> Quote Link to comment https://forums.phpfreaks.com/topic/330151-illegal-redirection-using-header/ Share on other sites More sharing options...
mac_gyver Posted 1 hour ago Share Posted 1 hour ago are you getting an error from the browser about redirecting (it would be a http xxx error number) or is this your - ' Illegal redirection from ...' message? note: require is not a function. the () around the path/filename do nothing and should be removed. Quote Link to comment https://forums.phpfreaks.com/topic/330151-illegal-redirection-using-header/#findComment-1658118 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.