Jump to content

Execute a piece of HTML


Sunamena
 Share

Recommended Posts

Hello,I am very new to HTML (still studying for it, so sorry if the question sounds silly xD), but i do have a question. And i was wondering if any of you would be able to help me out. So here goes:1. On many of my pages i will have the same Navigation list. One in the top, and one to the left. Also the footer should be the same on the bottom of the page. I would update those three regulary. Because it would be alot of work to do this in every page, i was wondering how i would do this? In my head i would have a small html file that says something like this: File name: unorderdlist1.html<ul><li>Thing 1</ul><li>Thing 2</ul><li>Thing 3</ul></ul>In the webpages i would like to put something like:Global structure of the HTML page goes here.

 

Execute a HTML file src="unorderdlist1.html".Global structure of the HTML page goes here.

 

 

 

So how exactly do i do this? That is considering this is possible ofcourse.Thanks in advance!=D

Link to comment
Share on other sites

You can't do that with HTML, but you can include the content using PHP.

 

Most websites using PHP or an equivalent server-side language to put the same content in multiple pages.

Link to comment
Share on other sites

You just need to have a local apache server installed, or domain on web host that supports apache php server language then

 

(1)Just create the file in question unorderdlist1.html with html code related to unordered list and nothing else;

(2) Make sure page it is going to be included in is php, and include it where you wish for it to show with

<?phpinclude 'unorderdlist1.html';?>

thats it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...