- Impact
- 149
Hello,
I've had a web page going for a little while now using very basic PHP (includes). However, the way I'm doing it seems rather inefficient compared to other sites I've worked on (but not built) before.
http://scca-racing.com/
As you can see, every page with content on it (with the exception of the forum) uses the same basic page template -- the header, left side, background, content area, and the copyright area. Right now, I have a basic "framework" for each page, that is simply the blank squares of each section. Where the main content area is, I have it including a page from my includes/ folder, which is just the content displayed there.
For example, on the Cup Series standings page: In my root directory I have cupstandings.php, which is the "framework" of the page that has an include to includes/header.php, includes/left.php, includes/copyright.php and includes/cupstandings.php, which is the content of the page.
Is there a way to simplify this process of creating a new framework page and only changing what one div layer includes for each page? I'd really like to just have one framework page that displays whatever content I ask it to. For example, if I have a file "octopus.php" in my includes/ folder, I'd like to be able to type in a URL that is actually the "framework" of that page with "octopus.php" as the content, sort of like "http://scca-racing.com/index.php?page=octopus.php" or something of that nature.
I don't really know what I'm talking about, but hopefully someone with more PHP knowledge than I have knows what to do. I've seen it done before, I just can't do it. Any help or advice is greatly appreciated!
Thanks,
Steve
I've had a web page going for a little while now using very basic PHP (includes). However, the way I'm doing it seems rather inefficient compared to other sites I've worked on (but not built) before.
http://scca-racing.com/
As you can see, every page with content on it (with the exception of the forum) uses the same basic page template -- the header, left side, background, content area, and the copyright area. Right now, I have a basic "framework" for each page, that is simply the blank squares of each section. Where the main content area is, I have it including a page from my includes/ folder, which is just the content displayed there.
For example, on the Cup Series standings page: In my root directory I have cupstandings.php, which is the "framework" of the page that has an include to includes/header.php, includes/left.php, includes/copyright.php and includes/cupstandings.php, which is the content of the page.
Is there a way to simplify this process of creating a new framework page and only changing what one div layer includes for each page? I'd really like to just have one framework page that displays whatever content I ask it to. For example, if I have a file "octopus.php" in my includes/ folder, I'd like to be able to type in a URL that is actually the "framework" of that page with "octopus.php" as the content, sort of like "http://scca-racing.com/index.php?page=octopus.php" or something of that nature.
I don't really know what I'm talking about, but hopefully someone with more PHP knowledge than I have knows what to do. I've seen it done before, I just can't do it. Any help or advice is greatly appreciated!
Thanks,
Steve
















