devhaven.com

Shop at Amazon.com!

Apache

Flash

PHP

MySQL

JavaScript

User Tips

My Tools

feedback

 

PHP - Discussion

Wednesday - 02/13/2002

Just learned a cool feature of PHP last night: using the require(); | include(); function(s) can really cut down on code maintenance. If you've programmed in 'C' then you know how to do this already. By placing code that is called on many pages into one [include file] you can update say your copyright notice once and all pages will reflect the changes.

The file can contain anything that you would put into any web page. Here is all that is needed to call an [include file]:

Notice the "../include/" reference in the example above. The "../" points to above the root web directory and the "/include/" continues down into a directory on a parallel to the web root directory.

It is recommended that you put your [include files] in a directory outside of your web directory structure. This keeps prying eyes from seeing your source code. That is if you need to hide your code. Either way it's most likely a good habit to get into if your host allows it.

Well that's all for today. Check back soon for more and if you want to add your thoughts please send'em and they will find their way onto the site somewhere.


Macromedia Flash 5.0
cover
Foundation PHP for Flash
cover

Support this site by making your purchase from Amazon.com through the above link(s).
Don't delay, get yours now.

Bluedomino Webhosting

Make payments with PayPal - it's fast, free and secure!