Archive for July, 2007

PHP Includes

Written by admin on Saturday, July 7th, 2007 in PHP Tutorials.

PHP has a very handy function called include(). This includes a page within the current page seamlessly. Whereas using iframes or frames in HTML is a seperate page to the parent one. include() can be very useful for when you want to inclide content based on a certain topic. Many CMS programs use the function and so do many many scripts. Here is an example of how include() is used:

<?php

include(‘file.php’);

?> The above code will put all the contents of file.php inside the current parent page. It will inherit all of the variables currently being used by the parent page aswell. So if there are database connections file.php will be able to use them without having to connect again.

(more…)



Site Navigation