Friday, 19 April 2013

PHP Include


Inside Server Includes (SSI).
You can put the PHP file in another PHP file before the server will man-plate your PHP syntax and functions there is the include () and require ().

If an error occurs between the two functions above it:
include () will still be running the PHP syntax your right to give warning Error.
require () fatal error message will appear and your website can not access.

This function is helpful because you do not need to repeatedly make the same display such header and footer with just one file header.php and footer.php you can tuck in all the pages of your website.

EXAMPLE:
<? php
include ('header.php');
echo 'Sample';
include ('footer.php')
?>

No comments:

Post a Comment