Reputation: 39
i'm sure this has been answered before, but I haven't really been able to figure out how to word it in order to get the desired answer I'm looking for.
I'm creating a website for a local shop that one of my buddies own(mostly for the fact that I have an interest in web dev and everyone else was asking ~500 for it)
I know that I could just copy/paste the html into every page, but I'm wondering if that's the standard way to have multiple pages in a website? I'm trying to do a good job on this website as opposed to just throwing it together and handing it over to him, plus it's a good learning experience to do things efficiently.
Thanks in advance to anyone that can help!
Upvotes: 2
Views: 88
Reputation: 12080
The term you're looking for is templating.
PHP itself is a templating language - you can mix code/HTML and include files inside other ones. This lets you share code across multiple pages. In the ideal case, you would have the logic in logic files, and only printing/looping constructs in template files.
Here is a nice tutorial that covers all the basics.
Upvotes: 2