How to Use Same Header Within a CSS/div tag built site

Hello,

I would like to achieve a design where i use only 1 header and one sidebarnav even if I have many html pages in my site.

Now this can be a bit confusing ill add a print screen that should explain better

I Would like to use the same navbar here on the right side and the same header. If i add a new page lets say page2.html i just right now copy page 1 add it to the navbar to get the identical design. Well it works but i want to use AdSense and i can just use a certain amout of AdSense blocks so i need to just have one header and one navbar for each added html page. Page1, page2 page3 and so on.

In the old days you just used frames to accomplish this but how do you do it in the modern world of div tags?

I hope my question is not too confusing.

with php (look into the php include function) or server side includes (SSI). you basically put just the html code for that particular part in a separate file, then place the respective php/ssi code at the exact position of where you want it to appear, and voila there it is - you would’ve to use .php instead of .html to make it work, and it won’t work on your local machine until you run a local server and place those files in the respective localhost folder (Xampp as server, htdocs the folder for example, Wamp and www if I remember correctly - and then go to http://localhost).

Hello this worked like a charm, suprisingly easy to implement, Thanks for the help here

Also, nothing is stopping you to use the same code for AdSense on other pages, or am I missing something here?

Well you are not allowed to use as many blocks as you like. Im no expert in this subject but I want to just use as few blocks as possible.

Off Topic:

P.S. is it really true, member since 2005 but never before posted here?

LOL, Yea its true actually, when i tired to sign up “again” my email was taken lol, i had to resend verification code but it worked out.

Ive always been interested in “scripts/desgin” but ive never really had the skill/curage to learn it but i can understand some concepts and read the code somewhat if its not too complicated. I remember when I did browse around here but apparently i didn do anything more than that.

These days its soo easy to use Wordpress for websites. But Wordpress is a bit clumsy for adsense when you really need to optimize colors design etc.

I think there should be a hall of fame 5 yrs to first post! :smiley:

with php (look into the php include function) or server side includes (SSI). you basically put just the html code for that particular part in a separate file, then place the respective php/ssi code at the exact position of where you want it to appear, and voila there it is - you would’ve to use .php instead of .html to make it work, and it won’t work on your local machine until you run a local server and place those files in the respective localhost folder (Xampp as server, htdocs the folder for example, Wamp and www if I remember correctly - and then go to http://localhost).

Also, nothing is stopping you to use the same code for AdSense on other pages, or am I missing something here?

Off Topic:

P.S. is it really true, member since 2005 but never before posted here?

glad it worked - I was very brief with my explanation and didn’t provide any code examples.

Wouldn’t it be the same block across those pages? sorry for not knowing this precisely, I only implement Adsense in CMS sites.

Welcome to Sitepoint! here’s your award: :award:

Also, do head over to the introductions forum and stick around a bit, sounds like you’re a nice chap!