Reading:
view - Your web site - what you need
view - Your web site - drawing up a specification
view - What can an 'active' web site do for you?
Database-driven websites
view - Hidden 'extras' of e-commerce
view - E-commerce on the cheap


Databases

If you've ever jotted a shopping list down, or created a spreadsheet of expenses, you've made the basis of a database - the collection of information that is related in some way.

The beauty of database-driven websites is that webpages can access this information in a variety of ways.

An example
Lets say that you actually make the shopping list up for 5 different families (don't ask me why, this is just an example). Next to each item then, is who the item is for.
Now you could upload the database to your website and have a page where each of the families could enter their family-name and get a shopping list just for them. But if one family decided they could pick up their next door neighbour's shopping too, you could quickly make a page that showed the shopping list for both families.

Going further, you might want to make sure no one else could see the shopping lists, so you'd add a login page before anyone could go further into the shopping list pages.

Now say you got sick of being the one who made up the shopping list every time, and wanted the families to add their own list over the week, why not put the database online, and each family could have access to add and delete items through a form on a webpage.

Hopefully this rather unworldly example gives you an idea of how a database-driven site could function.
A more real-world example might be a computer shop that puts out a weekly advert in the newspaper and runs a website in conjunction with the ad.
Every Monday someone in the shop goes to the admin part of the website and enters all the pricing for the next week. The database holds this, and last weeks pricing but only last weeks pricing is shown to the public.
On Tuesday, another employee, who works from home, goes to another password-protected page, gets the new pricing, makes up the new advert and sends it to the newspaper.
On Friday the newspaper ad appears, and the webpage is set up to update the pricing at 8am, to the now current prices, in sync with the new advert.

Lets look at another useful example.
Edit your own pages
Let's say you have a 'latest news' page that you intend to update every week. It's going to cost, and possibly be a hassle to employ someone outside of your organisation and get the new material to them each week, but you know that every Friday you have downtime while you wait for your children to come back from the pictures.
If you could update the pages yourself, you could plan this time for regular updates yourself.
With a snap of your web developer's fingers, you now have such a page and this is how it could work.
Friday afternoon, you go to a special 'admininstrator' page on your website. It asks for a username and password before you can proceed.
You now have a screen that displays the current articles on your 'latest news' page, and some buttons to delete each article, and add new ones.
You delete 3 articles but leave one other, about new visiting hours, which is still relevant. But you update the times for next week.
Then you add 3 new items, and go to look at the 'latest news' page. The page now has the new and updated content on. You feel very pleased with yourself because you still have time for a snooze before your children arrive.

Shopping carts are complex 'active' components of a website, generally with a database to collect and store information on a visitor's intended purchases.
The 'add item to cart' button (in the better shopping cart systems) puts the item information into a database, linked to that visitor. At any one time, the database might be holding many items from many visitors, but the link always means we know which belongs to who.
When the visitor goes to the 'checkout' page, the database presents all the items they collected, along with pricing and shipping costs.
This information is now available to you to complete the order manually through an admin section of the website, or if the site allows real-time creditcard transactions, they select 'process this order'.
The shopping cart has finished its job and generally the details are passed on to a credit card processor which in turn links into banking details, the card is verified, the transaction proceeds (or fails, if invalid) and your website is returned to with the status of the order.