View Single Post
  #4 (permalink)  
Old 02-14-2009, 09:47 AM
ishkey's Avatar
ishkey ishkey is offline
Moderator
 
Join Date: Aug 2007
Location: North GA USA
Posts: 1,773
ishkey will become famous soon enough
Default

The required_once() statement replaces itself with the specified file, much like the C preprocessor's #include works, and in that respect is similar to the required() statement. The main difference is that in an inclusion chain, the use of required_once() will assure that the code is added to your script only once, and avoid clashes with variable values or function names that can happen.

It is advised that you always put the complete URL in the require_once() perimeter ("http://www.yoursite.com/examplepage.php" and not just "examplepage.php") because URLs build on eachother based on their current location. If you put the entire URL in the perimeters, then the code will know exactly where to look for what code to carry over.
__________________

Consultant - Programmer - WebMaster
cleandeck - lawn mower undercoating
wilmargraphite - graphite lubricants
Reply With Quote