Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!us.feeder.erje.net!137.226.231.214.MISMATCH!newsfeed.fsmpi.rwth-aachen.de!news-1.dfn.de!news.dfn.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "J.O. Aho" Newsgroups: comp.lang.php Subject: Re: Seeking help with relative and absolute paths Date: Fri, 22 Mar 2013 08:11:54 +0100 Lines: 26 Message-ID: References: <3a0aadc7-316f-46de-bb15-0347af57810d@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net jQmXBosgvicea+w0frrsdweNG5hQfnj8tY9eiGUNJ8LlBFQisl Cancel-Lock: sha1:UMebHqo+O2mDU+f+DyPo/kQ/hbs= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130222 Thunderbird/17.0.3 In-Reply-To: <3a0aadc7-316f-46de-bb15-0347af57810d@googlegroups.com> Xref: csiph.com comp.lang.php:8796 On 22/03/13 05:24, The Frog wrote: > Thankyou very much for the replies. I appreciate the help. I have a follow-up question then regarding constants and setting them. If I define a constant say in the sites landing page (eg/index.php) will that constant then remain available for any scripts on pages that follow without having to 'require' them? In this case the A would exists in fileB.php, but it's a quite iffy way to do it, as if you include fileB.php from another script which don't have the define, then the A will be missing and you will end up with an error. A constant will only exists after it has been defined and will not remain in memory when you load a new page. > The reason I ask is one of ignorance on my part. Having consulted the php manual on constants I am unable to make a clear determination on their usage and scope. It would seem in my experimentation and learning that a constant does not in fact remain but in fact needs to be re-defined in each unique page change on the users part. While this can be accommodated in the scripts and pages that I write I am wondering if there is a better way? Define once and use many places? A constant will not magically live into another page, if you want a value to be set on pageA and then be accessible on pageB and pageC then use $_SESSION[] see: http://www.php.net/manual/en/intro.session.php -- //Aho