User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 374,572 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,779 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Jul 28th, 2005
Views: 4,772
Example of using INCLUDE to show a nav bar. For beginners. Simply uses include to show an external file (in this case, nav.php) and that's it! You can also include this in another page with a CSS style. The CSS will be automatically included in formatting the INCLUDEd page!
php Syntax | 5 stars
  1. <?php
  2. include("navigation.php");
  3. ?>
Comments (Newest First)
cscgal | The Queen of DaniWeb | Jun 13th, 2006
If you're goal is to deal with output, you may find that using ob_ is more flexible, as it lets you retrieve the output from external files and store them in variables for later use.

The syntax would be:

  1. <?php
  2. ob_start();
  3. $output = ob_get_contents();
  4. ob_end_clean();
  5. ?>

There are also a whole bunch of other ob_ functions. Check the php.net manual for more information.
Post Comment

Only community members can submit or comment on code snippets. You must register or log in to contribute.

DaniWeb Marketplace (Sponsored Links)
All times are GMT -4. The time now is 5:52 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC