Your Ad Here

 Navigation
Home
Source code
Tutorials
RSS feeds
Articles
Wordpress plugins
Books
Sample Chapters
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links




 Sponsors
 Links
dropshippers
wwwstores
golfing products
 Downloads
dzphp editor
EasyPHP
mysql_phpgenerator
php-studio-trial
phpdesigner_7_2_5
phpMyAdmin-3.4.3.2
/phptriad2-2-1
phpxedit_321
rapidphp 2011
WampServer2.1d-x64
WampServer2.1e-x32
xampp-win32-1.7.4-VC6-installer
xampplite-win32-1.7.3
 Misc
Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming

Valid XHTML 1.0 Transitional


Valid CSS!


Include files

Include files

This tutorial shows how to use the include() function.

The include() function can be used to call an external file from your server or even a different server.

Syntax

The general syntax for a basic include is as follows

<?php include("otherfile.txt"); ?>

This includes a file called otherfile.txt from the same directory on your server.

You can also use it like this

<?php include("http//www.myothersite/otherfile.txt"); ?>

This means you can share the same file on more than one site .

Advantages

Well the advantages are obvious if you are site is growing. Imagine you have a site with 50 pages and you have designed a nice
navigation area but you have forgotten a download link. This would require 50 changes to your site but using an template with an
include file you would change the include file content and all the other pages would be updated .




Books
 Sponsors


 Random Code
encrypt a password(string)
hexadecimal to decimal conversion(math)
using the md5 function to encrypt data(beginner)
 Random Article
  Network
Programming resources
Tutorials directory
Hosting resources
ASP site
Domain names
Progged
Maxi directory
bigarticle : free articles
A Code
Code N Tutorials
Get PHP
Programmers help




beginners PHP Copyright © 2004 onwards by beginnersPHP.