Re: create html from flat file
- From: Jerry Stuckle <jstucklex@xxxxxxxxxxxxx>
- Date: Fri, 06 Jun 2008 06:39:14 -0400
lxy one wrote:
On 6 Jun, 03:30, Jerry Stuckle <jstuck...@xxxxxxxxxxxxx> wrote:lxy...@xxxxxxxxxxxxxx wrote:Using a flat file containing table names, fields, values whats theIf you're going to go to all that trouble, why not just create the html
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.
I was thinking maybe the flat file could use xml. And maybe this flat
file could be generated using :
1. the database data and
2. a template file to indicate the controls that should appear on each
html page.
Maybe there could be existing html pages that could be used in the
generation of the required final html pages ie maybe they could
contain static data - such as layout, headings and tags as to where
fields, controls need to be placed.
Searching on this is difficult as the key words are too common :
create, html, xml, dynamic, template etc results in million+ hits.
page from the flat file and store it as a static page? Then when the
flat file changes, regenerate the html.
Much simpler (and server-friendly) than recreating the same page on
every request.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@xxxxxxxxxxxxx
==================
Hi Jerry,
But thats exactly what I want to do.
1. Create a flat file that will contain
-a) tables/fields+data values
-b) web page(form) details ie the fields/controls to appear on each
web page.
2. Generate the (static) web pages from the flat file.
3. If flat file is updated then update web pages.
OK, I understand better now.
So the issues are :
1. flat file - what format should this be in - xml ?
The simple answer is - whatever form suits you best. I've seen xml files, csv files, php code and even just plain text. It all depends on the data and what's easiest for you.
I would think that since your file needs to contain tables/fields and data, xml might be easiest to parse and maintain. But that's probably because I've worked with xml a fair amount. But if you haven't, another form (such as csv) might be easier.
2. How to generate the (static) web pages (forms) from the flat file
bearing in mind that I would like to control over what web pages +
tables/fields/data + controls are created.
Well, you'll have to read the file then display all of the information on a web page. Then select the information you wish to display. Finally, generate the page.
But maybe this is to difficult. Maybe it would be easier to have the
static web pages I want already created. The pages could have tags to
indicate where fields + controls (if available in the flat file)
should go.
You're now talking about a templating system, which is very popular. The nice thing about it is it takes a lot of the "grunt work" out of the code required to generate the page. It also separates the rest of the page from the actual data being displayed, making it easier to maintain.
I would have thought something flexible like this : generating static
web pages using data/controls from a flat file : had already been done
but I've not found anything yet.
I've used it before, when the data doesn't change very often. It can be very effective on high usage sites. For lower usage sites and data which changes fairly regularly, I just generate the pages dynamically on request.
And I think you'll find most of the systems use a database instead of a flat file. It makes things a lot easier - the database manages the data for you, so you don't have to do as much in your code. Simple SQL requests are not that hard to learn, and if you're going to be serious about web development, they're pretty much a requirement nowadays. SQL is just too powerful to ignore.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- Follow-Ups:
- Re: create html from flat file
- From: lxy one
- Re: create html from flat file
- References:
- create html from flat file
- From: lxyone@xxxxxxxxxxxxxx
- Re: create html from flat file
- From: Jerry Stuckle
- Re: create html from flat file
- From: lxy one
- create html from flat file
- Prev by Date: Re: Please check my auth login script
- Next by Date: Re: How to test that an array is 'indexed' vs 'associative'
- Previous by thread: Re: create html from flat file
- Next by thread: Re: create html from flat file
- Index(es):