View Full Version : any probs having most pages end .php?
Mar 30, 2008, 10:17 PM
I'm using Kompozer at the moment and to replace the "Components" function of GoLive (which I found destroyed the code worse than Kompozer) I am using php scripts. This is so that I can design a php include page for my menus, and if I have to just edit the MENU navigation bar page rather than ALL the pages on my website. Something to experiment with anyway.
So.... are there side effects having all web-pages end in .php instead of html? Are there browsers that have more trouble with this? Thanks.
Mar 30, 2008, 11:00 PM
All of my pages have a .php extension. Most include php script, but some don't. I've never had a problem.
Mar 30, 2008, 11:07 PM
I use php ssi's on my website for the Nav pane as well as header and footer sections but I kept the .html page endings instead of changing them all to .php.
I added the following Apache Handler that made the server parse the .html pages. Easier than renaming files.
AddHandler server-parsed .shtml
I don't know if this will work in your case but hopefully someone with more experience will post more.
I can't think of any side effects.
Mar 30, 2008, 11:14 PM
Name your page something.php
and so on.... Whatever constants you want displayed on every page.
Mar 31, 2008, 01:53 AM
OK Notnek, but does doing that place them all together? ? What code do I need on the include pages to tell the headers and footers where to go, if you see what I mean? I thought the PHP script had to be put on the page where you actually wanted them to show up, not bunched up together?
Mar 31, 2008, 02:03 AM
Turns out, I was wrong. I got out a trusting book and found the right answer. I'll just explain how to do it for your menu.
Create a file named navigation.inc
In this file, treat it as any html page. Layout your divs, content, css, whatever. But just your menu code.
In your regular pages (something.php), where you're menu would go:
<?php require('navigation.inc'); ?>
That will output the menu that you created in navigation.inc
If you want to have every section of your page like this, just create more pages like header.inc and footer.inc. Then the format of your site will be consistent and when you want to change something, you just have to edit one file rather than all of them.
I hope this helps. Sorry for being wrong and confusing earlier!
Mar 31, 2008, 03:16 AM
Oh? I thought the code was...
<?php include("myinclude.php") ?>
It works for me... you can see at this page the only thing I actually had really on this page was the title in bold, everything else comes from my test menu php page.
(Just very basic for testing purposes).
The php code has gone invisible though... it used to be pink!
Mar 31, 2008, 03:23 AM
That works. PHP will be invisible in the source and on the page. That's one thing that makes it great. As long as you're getting the content from the include file, then it's correct. Good luck with the rest of your project. If you need any help with more stuff, just PM me.
vBulletin® v3.8.6, Copyright ©2000-2013, Jelsoft Enterprises Ltd.