At a conpetual level, you will need to take the form values, connect
to a database and then add a new record into this database - with the
rcord containg the form values.
There are many ways to back-end your website with a database. Here is
an example of using something called Cold Fusion from Macromedia. The
Cold Fusion server is "known" tp the web server in that whenever the
web server encounters a file with the suffix ".cfm", the web server
passes the file to the Cold Fusion server. The Cold Fusion server then
processes the contents of that file and executes any instructions
found within. The Cold Fusion server in turn connects to many types of
databases - dBase, Foxpro, Oracle, etc.
Here's an example of a simple form called updateRecord.cfm to update a
record about a book in a database - nothing too special, looks like
your normal html markup:
<form action=updateIt.cfm method=post>
title: <input type=text name=title maxlength=250 size=20><p>
Author: <input type=text name=author maxlength=75 size=20><p>
Publisher: <input type=text name=publisher maxlength=100 size=20><p>
Cost: <input type=text name=cost maxlength=6 size=6><p>
Copies: <input type=text name=copies maxlength=3 size=3><p>
<input type=submit value=enter>
<input type=reset value=clear>
</form>
So when someone enters the various field values and clicks on the
submit button, the form values will be passed to the updateIt.cfm file
which in turn is executed by the Cold Fusion server.
The updateIt.cfm file looks like the following - any tag starting with
"<cf" is a Cold Fusion markup tag and will be executed by the Cold
Fusion server. The comments should help explain what's going on:
<!-- "datasource" refers to a database definition previously -->
<!-- setup within the Cold Fusion server admnistration interface. -->
<!-- This database is made up of one table and "n" records in that -->
<!-- table. Each record has the fields, "title", "author", -->
<!-- "publisher", "copies" and "cost". -->
<!-- Find the book we want to update based on the name of the book.-->
<cfquery name="dbase" datasource="books">
select * from books
where title="#form.title#"
</cfquery>
<!-- Obtain form variable values and set the field values for a -->
<!-- record. Then update the record with the new values. -->
<cfquery name="dbase" datasource="books">
update books
set title="#form.title#",
author="#form.author#",
publisher="#form.publisher#",
copies=#form.copies#,
cost=#form.cost#
where title="#form.title#"
</cfquery>
The above is just one way in which you can back-end your website with
a database. Most ISP providers will provide packaged solutions that
will get you going relativley quickly.
Hope this helps. |