This PHP example program demonstrates the two ways to include a php file and states what the effects are.
<!DOCTYPE html> <html> <head> <title>XoaX.net: PHP</title> </head> <body> <?php include "IncludeThis.php"; require "RequireThis.php"; ?> </body> </html>
<?php $sMessage = "If this file is not available, the include directive will cause a warning (E_WARNING), but will allow the script to continue executing."; echo "<pre>".$sMessage."</pre>" ?>
<?php $sMessage = "If this file is not available, the require directive will cause a fatal error (E_ERROR) that will cause the script to stop executing."; echo "<pre>".$sMessage."</pre>" ?>
© 20072026 XoaX.net LLC. All rights reserved.