473,569 Members | 2,844 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2256

"Peter" <th*******@gmai l.comwrote in message
news:11******** **************@ b28g2000cwb.goo glegroups.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************ **********@b28g 2000cwb.googleg roups.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******@eminen t.demon.co.uk.n ot.this.bit.no. html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.dem on.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*******@attgl obal.net
=============== ===
Oct 13 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3462
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 fgetcsv(), modify the index contents it if/as necessary. I then position the pointer back to the beginning of that record using...
7
8788
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 system requirments. 2. should be roubust and fast. 3. must be able to handle a bit large tables( upto 5000 rows) 4. should be available for both...
13
3404
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 using a flat file to storing data. I have to do this because mySQL is not installed on my web server, and I am not the root user. The amount of...
1
2180
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 know some basics on databases, have VB Pro programming experience over the years, and I know most of what we need to carry as far as data; I have...
5
3021
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); echo "<span style=\"normal 11 Verdana; color:#fff; text-align:justify;\">"; foreach($data as $element) { $element = trim($element);
7
2270
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 one bit of dynamic content: the info on what fruit is in the juice and where it is coming from (vendor, country etc.) today and tomorrow (the...
9
2182
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 with many configurations settings, once the options are set the values will not change much. So I thought it would be a good idea to move the data...
9
1881
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 database. Everything worked fine till my website gets good traffic. When website is getting good traffic, this method is slowing down the entire...
15
5249
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 show - text boxes, input boxes, buttons, hyperlinks ie the usual. The data is not obtained directly from a database.
0
7695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7922
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7668
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6281
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5509
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.