October 25, 201213 yr Hi guys, I am making a website for a football team i'm coaching. I have only done this for my own personal amusement so my skills have been obtained from google and youtube. I have made a site www.dryburghathletic.co.uk. Any time I have tried to use frames they haven't worked or look awful. I have made the pages with css and html, using div's as i'm comfortable with those. The problem is that if I decide I want to change one of the menu buttons (such as Contact Us to Club Shop) I have to go through and do this on 30 or so pages. I have just activated my Virgin webspace with PHP. I was wondering if there's any techniques I could use in any format that would allow me to make a change to one menu and have it apply to all pages? Thanks for reading all that! Hope you can help. Kev
October 26, 201213 yr Hi Kev, You can use the function include from PHP To do this, you need to change the file typ of your .html files to .php Otherwise php won't work. So you put all your code from your menu in the menu.php file and save it into your root folder. Then you include the file on everypage under your header and above your content Here is an example menu.php <?php <div id="menu"> <ul> <li><a href="#">Menu Item 1</a></li> <li><a href="#">Menu Item 2</a></li> <li><a href="#">Menu Item 3</a></li> <li><a href="#">Menu Item 4</a></li> <li><a href="#">Menu Item 5</a></li> </ul> </div><!--end menu--> ?> Then you include the php file like this: <html> <head> </head> <body> <div id="header"> </div> <?php include 'menu.php'; ?> <div id="content"> </div> </body> </html> If you have more questions, just ask
October 27, 201213 yr Hello RowruffDesign, That's an Great idea. This is the best practice to use when we are working with huge pages more than 30, so this method will be a good and time saving practise. Thanks and Regards, Alan
Create an account or sign in to comment