Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

ercw

macrumors regular
Original poster
May 4, 2006
104
0
So I know the benefits of php as far as what it can do to sites with databases.
I also know that it can parse input information in a page such as calculations, password protection, Email forms etc...

My question is: How can PHP be useful on a design stand point alone.
Any benefits in creating a non-database site with PHP?
 
templating.

By using simple includes you can have your header, footer, and other parts of the site that get called often in separate files so that you change it in one place and it changes on all your pages that use it. It also keeps your design simpler since you are not duplicating code. Write it once.
 
AmbitiousLemon said:
templating.

By using simple includes you can have your header, footer, and other parts of the site that get called often in separate files so that you change it in one place and it changes on all your pages that use it. It also keeps your design simpler since you are not duplicating code. Write it once.


Right. I already use HTML includes for that purpose. are PHP includes better?
 
AmbitiousLemon said:
templating.

By using simple includes you can have your header, footer, and other parts of the site that get called often in separate files so that you change it in one place and it changes on all your pages that use it. It also keeps your design simpler since you are not duplicating code. Write it once.


Yup, at the previous company I was with we used PHP to load a different CSS file dependent on which client was logged into our back end system. The client logs in and sees their logo & colours when editing their site, it was pretty spiffy before our employer bastardized it...not that I'm bitter...
 
I'm guessing he means SSI includes, right? With PHP includes you can have more control. Say there is a small difference with your footer on your front page than on all the other pages. You can stick an if statement in the footer to make the change for that single page. Or in the nav bar so you can't click on "Home" when you're actually on the Home page. Stuff like that.
 
DavidLeblond said:
I'm guessing he means SSI includes, right? With PHP includes you can have more control. Say there is a small difference with your footer on your front page than on all the other pages. You can stick an if statement in the footer to make the change for that single page. Or in the nav bar so you can't click on "Home" when you're actually on the Home page. Stuff like that.

Sorry, I did mean SSI. (I'm just an old fart)
Do you know of any good sources or example codes for this subject?
Thank you
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.