How to include menu in every page | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How to include menu in every page

I want to include common menu( with hyperlinks) in every page, I will be changing it every day, So I cannot manually edit code in every single page, So I want to code it once and include it in every single page, can you give me a solution?

5th Feb 2017, 4:46 PM
HarishUdupaS
HarishUdupaS - avatar
3 Answers
+ 3
put your menu without head and body in a separate file. you can then include it with PHP in all other files in the body.
5th Feb 2017, 4:52 PM
Mario L.
Mario L. - avatar
+ 3
just insert <?php include(“menu.html“); ?> where you want your menu to be. the file containing the menu is called menu.html in that case.
5th Feb 2017, 5:00 PM
Mario L.
Mario L. - avatar
0
can you please say how to code it in php
5th Feb 2017, 4:53 PM
HarishUdupaS
HarishUdupaS - avatar