Home Php php Include
Questions:Ask|Latest

 
 

Share on Google+Share on Google+

php Include

Advertisement
Include command provides the opportunity to include several php pages within a single page.

php Include:

     

Include command provides the opportunity to include several php pages within a single page. This feature facilitates us to save our time. Include takes a file name and simply inserts into the mentioned file.

It is very useful in the sense that if you want to put a menu or similar thing in every web-page then you can use Include, and whenever you need to make any changes into the menu, just modify the actual file and the changes will be shown in every single web page.

Let's consider an example of that we have two examples of chat and mail system and we want to put these links in each page:

mail.php is the file for mailing purpose and chat.php is for online chatting purpose.

Now write the following syntax in the file which will serve as the link to the multiple pages (in this case let's consider name of the file is phpLink.php):

<html>

<body>

<a href="chat.php">Chat</a>|<a href="mailPhp.php">Mail</a>

</body>

</html>

Now to get this links in every desired page, all we have to write is:

include("phpLink.php");

To include the links all we have to type the above code in desired files.

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 17, 2009

Related Tutorials

Ask Questions?    Discuss: php Include  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com