| | |||||
| ||||||||
| Webmaster Tutorials Instructional webmaster-related how-to's and tutorials. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| New Member Join Date: Aug 2003
Posts: 3
![]() | PHP require() & include() One of the most useful functions that PHP can perform are the require and include functions. These two functions are very similar in the action that they perform. They can call a page from anywhere in your directory (or another one) to a page. The most comment use for this is where headers and footers are involved. Say, for instance, you have a 10 page web site and you need to edit the links of the page which happen to be text links and appear at the top of each page. With PHP instead of having to edit each page individually you can edit just one - which in the long run will save you a lot of time when editing your pages. To achieve this, you need to split your page into three sections: a header, the main page and the footer. ????: NamePros.com http://www.namepros.com/webmaster-tutorials/15167-tutorial-using-php-require-and-include.html Copy the header of the page into a new file and name this new file "header.php" and do the same for the footer, except name this file "footer.php". Then delete the "header" and "footer" from each of the other pages. Where the header of each file was enter this code: PHP Code: PHP Code: More where that came from @ http://www.the-dev.net |
| |
| | THREAD STARTER #2 (permalink) | ||||
| New Member Join Date: Aug 2003
Posts: 3
![]() | FAQ: The difference between include() and require() This is a question I get asked so many times, I'll clear it up here and now...
More from where that came from @ http://www.the-dev.net | ||||
| |
| | #5 (permalink) |
| NamePros Regular Join Date: Nov 2003 Location: houston
Posts: 234
![]() | Thanks for the good info!
__________________ www.seriousdiscussion.com Serious talk forum for serious people. AOL is like the best written virus I've ever seen... For Sale Cheap! buybook.biz codingheaven.com phpxpert.com cityOfBerlin.info sedp.us |
| |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |