473,394 Members | 1,852 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

PHP flat file vs DB for a small website

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
6 2242

"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
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
>
>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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: BT3 | last post by:
I am trying to replace a single record in a flat file. The file is relatively small and no need for database. I open the file, and save the ftell() value in a variable. I read a record using...
7
by: mir nazim | last post by:
hi. i want to know if there is any flat-file relational database system available for python. i require it in a project. it should have following capabilities: 1. should be small and compact on...
13
by: raykyoto | last post by:
Hi all, I'm sure this is a popular question that comes up every few months here. Indeed, I've looked at some of the past postings, but I would like to ask things differently. Basically, I'm...
1
by: Tim Fierro | last post by:
Hello, I have had many years using flat file databases (File Express from way back) but am now at a company where a relational database is needed and would carry us into the future. Since I...
5
by: Dalibor | last post by:
I wrote some code for displaying news on my website. Code goes like this: <? $newsfile = 'news.txt'; echo "<B>TRENUTNE VIJESTI</B><br>\n"; $data = file($newsfile); $data = array_reverse($data);...
7
by: danielbaars | last post by:
Hello, I'm almost a complete newbie to using PHP and I was hoping one of you guys can point me in the right direction. I'm working on a site for a brand of handmade fruit juice and it only needs...
9
by: FFMG | last post by:
In my site I have a config table, (MySQL), with about 30 entries; the data is loaded on every single page load. This is not the only call to the db, (we do a total of about 8 calls to the db). As...
9
by: =?Utf-8?B?TmF2YW5lZXRoLksuTg==?= | last post by:
Hello I am developing a system for user tracking. In this I am tracking all the visitors that came to my website. i developed this using a HTTPModule and storing the data in a SQL Server...
15
by: lxyone | last post by:
Using a flat file containing table names, fields, values whats the best way of creating html pages? I want control over the html pages ie 1. layout 2. what data to show 3. what controls to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.