WeCodeThings Library
Library of code bits
Glossary    Contact Us
Need a web designer? visit WeCodeThings.Com for more details
Search  
   
Browse by Category

WeCodeThings Library .: PHP .: How to include a file with PHP using the includes and require function



How to include a file with PHP using the includes and require function

The include() Function

Simplest way to include a file with PHP.

<?php include('header.php'); ?>

The require() Function

<?php require('header.php'); ?>

The require() function is identical to include(), except that it handles errors differently.

The include() function generates a warning (but the script will continue execution).  You will still see the error on the page, but after the error message, you will see all code executed after that.

The require() function generates a fatal error and the script execution will stop after the error, generating no execution of any code before or after.

 



How helpful was this article to you?

Related Articles

article Flex 3 Get Data from a CFC ColdFusion using bindable result handler function
More about creating a remote object and...

(No rating)  4-21-2009    Views: 894   
article PHP Mail Function Multiple Emails, People, To, or Recipients in Email PHP
When constructing the mail function with...

  5-27-2009    Views: 898   
article How to display Random Quote using ColdFusion and the RandRange Function
<!--- Be sure to change...

(No rating)  4-7-2009    Views: 925   

User Comments

Add Comment
No comments have been posted.




.: Powered by Lore .:Code by WeCodeThings Website Design and Development