Jump to content
Larry Ullman's Book Forums

The Config file


Recommended Posts

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

 

 

Link to comment
Share on other sites

  • 2 weeks later...

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. 

Link to comment
Share on other sites

 Share

×
×
  • Create New...