Argolian Posted December 8, 2014 Share Posted December 8, 2014 I was wondering if it's possible to retain loaded files and the current error setttings after a header("Location: xxxx.php") is issued, for example in this: // Start up the session - not used yet but there just in case session_start(1); // Enable the Autoloader and initialise it require_once 'Autoloader.php'; Autoloader::init(); // Check if the application has been installed yet ---------------------------- if(!file_exists('Engine/config.php')){ session_write_close(); header("Location: install/index.php"); die(); } And I get a class not found error when I open the install/index.php session_start(1); // @todo: Disable this in the production version .... I already did this in the main index -- do I have to do this on all pages that may error? error_reporting(E_ALL & ~E_STRICT); ini_set("display_errors",1); // Because we jumped here, we have to reinstall the autoloader -- why? require_once '../Autoloader.php'; Autoloader::init(); While I can understand I wouldn't want this if I was firing off to a completely different site, is there anyway to retain the settings within the same server environment or do I have to reset everything as above. I even tried using session in the hope that this would 'remember' but it didn't work. Quote Link to comment https://forums.phpfreaks.com/topic/292961-need-help-with-php-headerlocation/ Share on other sites More sharing options...
CroNiX Posted December 8, 2014 Share Posted December 8, 2014 A redirect is a completely new web request that knows nothing about any previously loaded code/classes because it's the same as just entering a new url in the browser. Quote Link to comment https://forums.phpfreaks.com/topic/292961-need-help-with-php-headerlocation/#findComment-1498976 Share on other sites More sharing options...
hansford Posted December 9, 2014 Share Posted December 9, 2014 Is there a reason you need to change locations. Why not just require that file since the current file is apparently done processing. require('install/index.php'); Quote Link to comment https://forums.phpfreaks.com/topic/292961-need-help-with-php-headerlocation/#findComment-1499059 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.