dmx1 0 Posted September 17, 2020 Report Share Posted September 17, 2020 Hi Larry, I'm a newbie so please forgive the basic questions On page 60, you wrote the code: if(!defined('LIVE')) DEFINE('LIVE', false); You said if you wanted to allow the live setting to be set on a single page, in order to debug that page, you would write: DEFINE('LIVE', true); require('./includes/config.inc.php'); I don't really understand this logic. If you wanted to debug a specific page, you would write on the specific page, DEFINE('LIVE', true); require('./includes/config.inc.php'); So 'LIVE' would be set to true, then the config.inc.php file would be called, but my confusion is: QU 1: After the config.inc.php is called, how would that debug the specific page in question ie, how would that then link back to the specific page you wanted to debug? Qu 2: In the above scenario, is the website initially offline, ie localhost, because 'LIVE' is set to false, and you have then changed 'LIVE' to true, in one page, in order to see how it operates in a live environment? Qu 3: Can you explain the process of setting 'LIVE' to true on one specific page ie, the config.inc.php file is called and............ Thank you. regards Quote Link to post Share on other sites
dmx1 0 Posted September 17, 2020 Author Report Share Posted September 17, 2020 Also, why do you need to call the config.inc.php file in every page? Quote Link to post Share on other sites
Larry 428 Posted September 28, 2020 Report Share Posted September 28, 2020 Sorry for the delayed reply! As for why you need to include (not call) the config.inc.php file on every page, that's how you ensure that every page in the site has access to the same information and is configured to behave in the same way (e.g., handle errors). This is both a common thing to do and rather important. As for the other specific questions, are you still unsure about those? If so I'll revisit the code and the book to ensure I can explain it properly. I don't remember that logic off the top of my head. Quote Link to post Share on other sites
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.
Note: Your post will require moderator approval before it will be visible.