| Home > Computer & I'net > Include... |
Include | |
include ("filename.php"); Include will pass the information from an external page into the current one. The information that is passed will be known and usable to the coding that appears after the include command. Coding that appears before the include command will not "know" about the information contained in the included file. info.php <?php $color = "yellow"; $fruit = "bananas."; ?> test.php <?php echo "I like $color $fruit <br>"; include ("info.php"); echo "I like $color $fruit <br>"; ?> Results : I like
I like yellow bananas. One of the many uses of includes is to set common webpage areas into seperate files and include them into each page like a template style layout. This site uses php includes. One for the main header area, one for the navigations, and one for the footer area. ----------------- Article by David Stanley. Visit his site http://www.htmlite.com. Reprinted with permission. | |
| Articles |
•Auto & Trucks•Business•Computer & I'net·General·Apache·CSS·Database·Hardware·HTML·Javascript&DHTML·Linux·MySQL·Operating System·Perl / CGIPHP·Programming·Publishing·Search Engines·Software Problems·SSI·Tips & Tricks·Utilities·Web Design•Family•Food & Drink•Gardening•Health•Other•Pets•Psychology•Spiritual•Travel•Women |
| Calculators |
|