ppowell777 Posted Sunday at 04:07 PM Share Posted Sunday at 04:07 PM 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 Sunday at 05:00 PM Share Posted Sunday at 05:00 PM 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...
ppowell777 Posted Sunday at 06:38 PM Author Share Posted Sunday at 06:38 PM It wasn't from the browser; it came from tokencheck.php itself due to an error accidentally resetting the value of $_SESSION['token'], which has been resolved Quote Link to comment https://forums.phpfreaks.com/topic/330151-illegal-redirection-using-header/#findComment-1658119 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.