Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Change webpage content without re-using navigation bar on all the pages

I’m working on a website and I want to change the page contents when a user selects which page they want to navigate to. What I’m trying to accomplish would be like ASP.NET where you have only 1 navigation component that is used across all pages and the content of the page changes when a user selects a different page. How would I be able to accomplish this if I’m building a website with HTML/CSS and PHP. Any information I’m getting is how to change page content dynamically from PHP. I want to change the page content from other files in my directory

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You can use PHP include function to control elements from only one file
write this in your index.php

and in header.php write the code like

<header>
  ...
</header>

and you could add css, javascript, jquery resource files into index.php

And advantage of include code is when visitor look at your page source or developer tools’ source it will appear as your header.php file not php include line.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading