| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Jun 29, 2004, at 9:39 PM, Gary Minato wrote:
I use the php require() function when the same content must be included on every page, eg
<?php require("navigation.inc"); ?>
I use include() if I need to provide options when using if, else or other statements, eg
<?php $request="boy"; if ($request=='boy') { include("boy.php"); } else { include("girl.php"); } ?>
From <http://us2.php.net/require>
require() and include() are identical in every way except how they handle failure. include() produces a Warning while require() results in a Fatal Error. In other words, don't hesitate to use require() if you want a missing file to halt processing of the page. include() does not behave this way, the script will continue regardless. Be sure to have an appropriate include_path setting as well.
Hope these help, Tim _______________________________________________ web-development mailing list | email@hidden Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/web-development Do not post admin requests to the list. They will be ignored.
| References: | |
| >php include() (From: John Crockford <email@hidden>) | |
| >Re: php include() (From: Gary Minato <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.