|
Notices |
![]() |
|
Thread Tools | Rate Thread | Display Modes |
![]() |
#1 | |
Registered User
Join Date: May 2012
Posts: 4
|
![]()
One of the main problems faced by webmasters is saving time when it comes to creating websites. When starting a website, one may choose to create a navigation menu like the following to link to each page:
Code:
<a href="http://www.yoursite.com/index.htm">Home</a> - <a href="http://www.yoursite.com/about.htm">About Us</a> - <a href="http://www.yoursite.com/links.htm">Links</a> - <a href="http://www.yoursite.com/contact.htm">Contact Us</a> So now, you have your 4 pages - and all is well. But, as the site expands you need to integrate a forum - which leaves you with 4 pages to update. No problem at all... But supposing the site had 100+ pages! That would be a very monotonous time consuming job. This is where we bring in the php include command to really speed things up! Create just the navigation menu on its own, and rename all of your pages to .php In this case, the navigation menu will look like this: Quote:
Save this file as "menu.inc" as we will be including it elsewhere - hence the .inc extension. Now, open up your .php pages that the menu links to, and simply add the following code at the very top, to include the navigational menu on the pages: <?php include("menu.inc"); ?> The code is telling the php page, to "include" the menu.inc file - and it does! Once this has been added, any changes in the menu.inc file are reflected across the whole site making updating a lot easier! Why stop at menus? This can be utilised for adverts, footers, headers, templates and much much more! Back to top
__________________
Make Money Online by locking links - bee4.biz/?ref=17978 |
|
![]() |
![]() |
![]() |
#2 |
Registered User
Join Date: May 2012
Posts: 117
|
very nice post thanks for sharing this valuable information.
__________________
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. || To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts. |
![]() |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Importance of Php Development for Web Development | tech.biztech | Programming General | 35 | 11-22-2019 12:37 AM |
Php | tonybrown2387 | PHP / mySQL | 16 | 08-01-2014 10:04 PM |
The best source of learn PHP easily at home. | chikkiarora | Programming General | 11 | 02-10-2013 02:18 AM |
PHP is an HTML-embedded scripting idiom | tommydenis | PHP / mySQL | 14 | 06-04-2012 02:15 AM |
Are you aware of the fact that PHP programming is the most widely used one? | johnrichards774 | PHP / mySQL | 3 | 02-07-2012 05:41 AM |