By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,569 Members | 1,350 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,569 IT Pros & Developers. It's quick & easy.

PHP flat file vs DB for a small website

P: n/a
Greetings,

I'm having trouble deciding on whether to go with a flat file or DB
driven architecture for a wee personal website. I'd like to be able to
update HTML files online and this is my only requirement.

Flat Files:
advantage: attach some PHP code at the top of each file that allows the
file to be opened and edited
disadvantage: the files would have to be writeable

DB:
advantage: more secure
disadvantage: allot of overhead

Would anyone have any advice?

PS: I was originally planning to use a CMS but found that no CMS was
customizable enough with little effort for a basic small website -
strang eh :)

Oct 12 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a

"Peter" <th*******@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Greetings,

I'm having trouble deciding on whether to go with a flat file or DB
driven architecture for a wee personal website. I'd like to be able to
update HTML files online and this is my only requirement.

Flat Files:
advantage: attach some PHP code at the top of each file that allows the
file to be opened and edited
disadvantage: the files would have to be writeable

DB:
advantage: more secure
disadvantage: allot of overhead

Would anyone have any advice?
Don't have any advice re flat vs db as I was uncomfortable with opening the
file permissions so i went with DB.
I'm not that comfortable with what's dangerous and what's not. I know just
enough to be dangerous ;-) As I understand it you need to allow write on the
directory as well as the file for 'other' but I'd have to test it to be
sure.
It just occurred to me a third way: use the PHP FTP functions to write the
file and that way you could keep the permissions tight. I do that now for
moving images from temp when they are uploaded for that very reason. Means
you need to have ftp user and pass stored somewhere on the server, so that
needs to be in a directory that can't be read from the web.

If all you want to do is update html online then that's fairly easy.
I don't see why you wouldn't just use ftp from your computer rather than go
to all the trouble of writing something to do it online.
But that's 'cos I can't exactly visualize what you do :-)

Most CMS I've dealt with allows you to put certain things in certain places
easily but if you go outside of the box then you are back to square one. So
it's a balance f ease of update versus what you can do.
>
PS: I was originally planning to use a CMS but found that no CMS was
customizable enough with little effort for a basic small website -
strang eh :)
I've found the same thing whenever I wanted something small it was easiest
to write my own than deal with the complexity of the simplest I found but it
wasn't an exhaustive search.
A lot of people are using blogs like wordpress in place of a CMS but I find
that to be a complex app myself, a sledgehammer to drive in a thumbtack.

Oct 12 '06 #2

P: n/a
Message-ID: <11**********************@b28g2000cwb.googlegroups .comfrom
Peter contained the following:
>Flat Files:
advantage: attach some PHP code at the top of each file that allows the
file to be opened and edited
disadvantage: the files would have to be writeable

DB:
advantage: more secure
disadvantage: allot of overhead

Would anyone have any advice?
Database. The overhead is no big deal, what will do a lot will do a
little. Plus the skills you learn will be more useful to you.

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Oct 12 '06 #3

P: n/a
>
>Database. The overhead is no big deal, what will do a lot will do a
little. Plus the skills you learn will be more useful to you.
Spot on!

--
PETER FOX Not the same since the deckchair business folded
pe******@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Oct 12 '06 #4

P: n/a
Peter wrote:
Greetings,

I'm having trouble deciding on whether to go with a flat file or DB
driven architecture for a wee personal website. I'd like to be able to
update HTML files online and this is my only requirement.

Flat Files:
advantage: attach some PHP code at the top of each file that allows the
file to be opened and edited
disadvantage: the files would have to be writeable

DB:
advantage: more secure
disadvantage: allot of overhead

Would anyone have any advice?

PS: I was originally planning to use a CMS but found that no CMS was
customizable enough with little effort for a basic small website -
strang eh :)
SQLite.

Jeremy
Oct 13 '06 #5

P: n/a
Thanks for the advice guys.

The FTP solutions sounds fun and nostalgic :) but I suppose I'll just
buckle down and make a wee database driven website. I've been
programming database driven websites in perl and JSP for a few years
now so I'm not very worried.

-peter
PS: I haven't played with SQLite yet, thanks I'll give it a try ;)

Jeremy wrote:
Peter wrote:
Greetings,

I'm having trouble deciding on whether to go with a flat file or DB
driven architecture for a wee personal website. I'd like to be able to
update HTML files online and this is my only requirement.

Flat Files:
advantage: attach some PHP code at the top of each file that allows the
file to be opened and edited
disadvantage: the files would have to be writeable

DB:
advantage: more secure
disadvantage: allot of overhead

Would anyone have any advice?

PS: I was originally planning to use a CMS but found that no CMS was
customizable enough with little effort for a basic small website -
strang eh :)

SQLite.

Jeremy
Oct 13 '06 #6

P: n/a
Peter wrote:
Greetings,

I'm having trouble deciding on whether to go with a flat file or DB
driven architecture for a wee personal website. I'd like to be able to
update HTML files online and this is my only requirement.

Flat Files:
advantage: attach some PHP code at the top of each file that allows the
file to be opened and edited
disadvantage: the files would have to be writeable

DB:
advantage: more secure
disadvantage: allot of overhead

Would anyone have any advice?

PS: I was originally planning to use a CMS but found that no CMS was
customizable enough with little effort for a basic small website -
strang eh :)
If all you're using it for is to update html files, you can keep
everything in flat files and just ftp them up. That's how most sites
are done, and it works quite well.

However, I also agree with other comments here. This is a nice way to
start learning SQL. You won't run into a lot of complexity, and the
overhead isn't that great.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Oct 13 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.