Created
September 12, 2012 00:27
-
-
Save meskarune/3703264 to your computer and use it in GitHub Desktop.
Include one html file in another
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #PHP include one html file in another | |
| 1. Save the HTML for the common elements of your site to separate files. For example, your navigation section might be saved as navigation.html or navigation.php. | |
| 2. Use the following PHP code to include that HTML in each page. | |
| <?php | |
| require($DOCUMENT_ROOT . "path to file/include-file.html"); | |
| ?> | |
| 3. Use that same code on every page that you want to include the file. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment