@tracknutJan 14.2022 — #Yes, that's a pretty standard way of including headers and footers. If you truly want the main file suffix to remain ".html" though, you'll have to configure (in .htaccess) php to read files with that suffix - usually it would not.
@tracknutJan 14.2022 — #You might also consider including just one php file at the top of the page, and in that php file you might have a whole bunch of useful php code including functions OutputHeader() and OutputFooter() which you call at the appropriate places. That would let you just include a single php file and get more mileage out of it that just the header and footer content.
@cipokauthorJan 14.2022 — #@ginerjm#1641528 Just a simple website, as depicted in the image. But with many images, so I would need to be able to change header/footer easily in any case.
@cipokauthorJan 14.2022 — #@tracknut#1641530 That does sound great! So that just one php file would be like a functions.php (from WP) with all I need to call inside my pages, right?
@ginerjmJan 14.2022 — #I would think that the header and footer would mostly be the same from page to page and the middle part would be the part that is different for every page. Why would you then need php for those?
And if you want to have your site "in HTML format" then each page is going to be a lot of work. Sure you can easily modify the header and footer with a few lines of php coding but the meat of the page is the real work, no?
And - all web pages are in html format. It's how they get built that is different from site to site.
@cipokauthorJan 14.2022 — #@ginerjm#1641535 Yes, I might need to make changes regularly to the menu so I wouldn't want to edit all the pages, I would just make changes to head.php for example
"What is this 'buy' that you refer to?" - I don't think I understand this question.
@NogDogJan 14.2022 — #Might want to use include instead of require, depending on whether you want the page request to fail with a fatal error if for some reason the file cannot be found/read (require will fail, include will just log a warning). The _once part for either of them is probably not really serving any purpose in this case, as you probably are not trying to define any PHP classes/functions in the included file?
My personal preferred method over the years has been to create a file that has a function for each "boiler plate" part of the page. Then I require_once that file, and call the relevant function where needed. [code=php] <-?php // had to add "-" to php tag for the forum to allow it require_once $_SERVER['DOCUMENT_ROOT'] . "/path/to/page_functions.php"; echo page_head('Title', 'list, of, keywords'); echo page_menu(); echo page_sidebar(); ?> <h1>My Page</h1> <p>Lots of amazing content here</p> <-?php // had to add "-" to php tag for the forum to allow it echo page_foot(); [/code]