I’ve recieved some emails regarding includes file. Apparently my source code is being viewed by some curious people.
Anyway, the includes file is very helpful if your building a wbsite with multiple pages. Your header and footer are the main reason you need includes. Every one of your webistes webpage will need a header and a footer.
First create a file “includes” this is where all your includes will reside. Then create the code that will be inserted in all your pages. Instead of copying the same code in every page, all you need is one copy in the includes file. Save it.
Now create the PHP includes code that will call the _includes code in the includes file. Embed the includes _header.html and _footer.html appropriately in each page and save.
If you need to modify the header of footer code, and you will from time to time, just go to the includes folder and open the file you need to make changes to, after you modify it, save it and your done.
This will affect every page that has the includes file you made changes to. Less work means more time to work on code that needs your valuable time.
Here are some suggestions for your first post.
- You can find new ideas for what to blog about by reading the Daily Post.
- Add PressThis to your browser. It creates a new blog post for you about any interesting page you read on the web.
- Make some changes to this page, and then hit preview on the right. You can always preview any post or edit it before you share it to the world.