EZDB 3.02
©
|
@table of content
COPYRIGHT NOTICE:
Copyright 1998-2001 Stephane Barde. All Rights Reserved.
This program is being distributed as a FREEWARE.
It may be used and modified by anyone, as long as this copyright notice and
the header
above remain intact, but any usage should be registered. (See the
chapter XIII- for registration information.) By using this
program you agree to indemnify Stephane Barde from any liability.
Selling the code for this program without prior written consent is
expressly forbidden. Obtain permission before redistributing this
program over the Internet or in any other medium. In all cases
copyright and header must remain intact.
Contributions are welcome and will be used exclusively to enhance
the script (contact EZ Perl at webmaster@ezperl.com)
I would off course appreciate to have some feedback about the
use you are doing with this script.
It also would be nice to make a link to the EZ Perl site http://www.ezperl.com
VERSION HISTORY:
3.02 1/31/01
- Binary uploads with
NT.
- Updated
examples set.
3.01 11/17/00
- External query bug
fixed
- <header> and <footer> parsing fixed in the line display
- Category Assignment right added at the group level
- <select> form tag parsing fixed
- HTML template at group level fixed
-
EzTree new global variables added
3.0 10/30/00
- Bad word parsing (reject
add/edit)
- Bulk update fixed
+ file_name=~s/ /_/g;
- Password expiration
- EzTree optional
- Password reminders
- header-footer replaced
by a single HTML template
- cart system
- crypted pwd
- ~date, ~group, ~group_owner.
Must use _*date, _*owner... and _~date,... to display special fields
- Global vars interface
- IP address login
restrictions
- Invalid login attempt
counter
- Order by insertion
date sorting fixed
- html_line_display
at group level
- cookie session check
- html_line_display
with
- Field default value
at group level
- Language Pack
- <select> form
elements
2.63 9/25/00
- Headers/footers for login, auhorize and connnected phases
2.62 9/22/00
- Table_group_form updated within the package
- Image upload backward compatibility
2.61 8/30/00
- Bulk deletions
- Reverse sorting
- Textarea fixed in file generated from wizard
- Record protection based on one database field
- No match html page
- Bulk update fixed and name_file_after scans for spaces
2.6 7/14/00
- Version # added
- Crypted session #
- Multiple default accesses using session=~/^default/i
- IP check optional
- Script name can be changed
- 'loggout' is shown instead of 'login' once logged
- order_by in the url using %%%%ob=field_name
- _RECORD_COUNTER_ and _KEYWORD_ parsed in the display_line files and
returning
the number of search results and the keywords entered.
- Auto Upgrade from 2.x to 2.6 in the wizard
- EzTree ©
- EzTree_fields field added to tables
- *date used as special field for date stamp
- _CONTEXT_ parsed in the headers, footers, display and form
files.
- Bug fixed on the order_by routine, on textarea fields generation
from the wizard
- special form name is now 'ezform' (ezrdb_from => ezform for
relational imports)
2.5 12/25/99
- Cursors (relational
display)
- Direct Full Display
parameter usable in the URL
- _LOGIN_ and _SESSION_
usable when displaying the db form
- Select form elements
parsed only for column name is used in a <select
> tag
- File generation:
named after columns, extension configurable.
2.1b 11/07/99
- Parameters in
the command line
for
queries with max_record_no
2.1 08/15/99
- Static HTML output
- EZ Wizards
- Order By Statement
- Image Upload
- Headers and footers
at group level
- Control over
the direct Full display
- Text Color for
Default display
- Multiple Selections
2.0 03/20/99
- Templates for
mail notification.
- Line Mode Display
automatically recognize <tr> tags
for
nice table formatting
- HTML file auto
generation
- Cascading additions
(ex: Member Account Generation)
2.0 PR1 02/18/99
- Relational flat databases.
- Display Mode
configurable from the search engine
- Accuracy of the
error messages
- Possibility to
create member account
- Display line
mode vs. tables
1.5 01/01/99
- First Shareware release
- Setup Analyzer
- Javascript added
to handle the problem of checkboxes
- Some bug fixed
(Modify vs. Full display mode).
- Search revised.
- Email Notification.
- Viewing restrictions
option at group level.
- GUI enhanced:
menu bar to navigate between system db.
- Ability to go
to the login page with table data.
- Go to connect
screen directly after login.
- Show authorized
table at connection.
- Display mode
configurable at group level.
- Separate folder
for system db
- Feedback utility
removed (useless with v1.3)
- Pop-down menu
for connection.
- Indexed fields
1.3 12/10/98
- Numerous bug fixed
- Search engine
enhanced: line mode + many options
- Headers and Footers
- Mandatory fields
and Unique Constraint
- HTML configurable
at group level
- Support default
values for html fields
- HTML fields in
read only access when displaying a form
- Aliases for table
path
- Log options at
table level
1.21 11/06/98
- Search page by page
updated
- Search result
sorted in alphabetical order
1.2 10/28/98
- sub display_feedback
- decrease size
of error message
- enhanced search
engine: added the following functions:
=,=~,=^,!=,!~,!^
plus case sensitivity
- Auditing function
implemented
- Exit after error
message
1.1 10/01/98 New User Interface + numerous bug fixed
1.0 09/11/98 FIRST RELEASE
Note 1: Compatibility
EZDB was tested developed on Unix (Apache / FreeBSD) and Windows (Apache / NT
4.0)
Note 2: Release 3.0
The 3.0 release comes with many new feature. Some functionalities
of older versions were re-written so we advise
that you
read carefully this user manual even if you feel familiar with EZDB.
I particular, pay attention to:
- Headers and footers are NO MORE supported. Instead, EZDB 3.0 uses a single
HTML template
- Many security
options have been added.
- The line display file now supports <header> and <footer> tags.
- The form <select> element now uses a different structure to support
within a given form different selection
boxes having common options.
- A selection feature allows to select records in a cart.
- The call to *date, *owner, *group_owner is now different
and ~date, ~owner, ~group_owner were added.
- Bulk deletion.
- Multilanguage Support.
Here is the manual for installing and using EZDB:
CONTENT:
I EZDB files and folders
II Global variables
III How to Create a Database
and Grant permissions
IV Create User Account and
Group Assignment
V About HTML's
VI How to access DIRECTLY
a table with default right
VII The search engine
VIII The Audit function
IX Cross Table References:
How to implement "Relations"
X Indexes
XI Cascading Additions
XII EZ Wizards
XIII EzTree
XIV Security
XV Selections
XVI
Language Support
XVII Support
--------------------------------------------------------------------------------------------------------------------------------------------------------------
I EZDB files and folders:
SETUP TAKES 5 MINUTES: Set the file rights properly (chapter 1)
Go to http://www.yourserver.com/cgi-bin/.../ezdb.cgi
CHECK YOUR SETUP: http://www.yourserver.com/cgi-bin/.../ezdb.cgi?setup
EZDB comes with the following structure:
./
|- ezdb.cgi 755
|
|- ezdb_setup.pl 644
|
|- ez_en.pl 644 (english language pack)
|
|- ez_fr.pl 644 (french language pack)
|
|- eztree.cgi 755
|
|- ezdb_lib.pl 644
|
|- ezhtml.pl 644
|
|- ezwizard.pl 644
|
|- report.cgi 755
|
|- /system_db/ 777
| |- user_session 666
| |- user_data 666
| |- user_rights 666
| |- tables 666
| |- table_group 666
| |- index 666
| |- db_cookie 666
| |- add_external 666
|
|- /system_db_html/ 755
| |- user_data_form.html 755
| |- ... 755
|
|- /my_db/ 777
| |- invoice 666
| |- product 666
| |- ... 666
|
|- /my_html/ 755
| |- invoice_form.html 755
| |- ... 755
|
|- /log_files/ 777
| |- invoice.log 666
|
|- /mail_templates/ 777
| |- invoice_add.txt 755
|
- The main program is ezdb.cgi: make it -rwxr-xr-x so that you can execute it.
- The package comes with 5 subfolders:
A- system_db: this is the folder containing
the system database:
Make it rwxrwxrwx
-> user_session
is a system file containing all the active
session. Make it -rw-rw-rw-
-> user_data
is a system file containing all the user name,
login and password. Make it -rw-rw-rw-
-> user_rights
is a system file containing all the user
permissions. Make it -rw-rw-rw-
-> tables
is a system file containing all the flat file
database informations. Make it -rw-rw-rw-
-> table_group
is a system file containing all the user group
information relative to each database. Make it -rw-rw-rw-
-> index
is a system file containing the indexes for user
defined tables (see chapter IX for detail).
Make it -rw-rw-rw-
-> db_cookie
is a system file containing the cookies left by users
navigating from one table to another.
Make it -rw-rw-rw-
-> add_external
is a system file containing the cascading additions
definitions.
Make it -rw-rw-rw-
B- system_db_html: this is folder contains
all system html files.
Make it rwxr-xr-x
C- my_db is a directory where you can
put your database.
Make it rwxrwxrwx (by default, it
contains the example db product and invoice)
D- my_html is a directory where you can
put your html's.
Make it rwxr-xr-x
Note: these html's will NEVER be
accessed directly but will be
scanned by the script. Therefore, it's not a problem to
have html's under your cgi-bin directory.
E- log_files is a directory containing
the log files.
Make it rwxrwxrwx.
(Make also the example log file
product.log and invoice.log rw-rw-rw-.)
F- mail_templates is a directory containing
the templates for mail
notifications.
Make it rwxrwxrwx.
Important Note 1:
The structure described here is just a suggestion: you can locate the folders
anywhere, except for ezdb_setup.pl, ez_en.pl, ez_fr.pl, ezdb_lib.pl, eztree.cgi,
ezhtml.pl, ezwizard.pl and the log_files folder which must be under
the root of ezdb.cgi.
Default setup: to get a quick overview of EZDB, keep the structure indicated
here (the package is setup to work with it)
Important Note 2:
You can use aliases for database:
For example, if you define the alias phone for the database
/usr/home/database/phone.csv, you just have to use the alias phone to connect
to it.
In consequence:
- You can name your database with extensions: my_db.csv, my_db.asc
- You can put your database ANYWHERE you want.
Important Note 3: Default Setup
- By default, the Administrator login is admin and the password is admin:
You can (and should) change it...
The admin_group is granted full power.
With this login you can connect to the following databases:
- tables
- table_group
- user_data
- user_rights
- index
- add_external
II Global variables:
Log in as Administrator and go to the 'Admin'
section, then select Global Variables to
change the global variables values.
You can also manually edit the ezdb_setup.pl
file
language | This variables
defines which language pack must be loaded. You should specify a 2 letters
value. By default, EZDB support english ('en') and french ('fr'). |
script_name | You can rename ezdb.cgi into any other name by changing this variable and renaming the script. |
script_url | This is the script url. '.' by default. |
session_max_duration | $session_max_duration
is a variable defining the maximum duration of a session in seconds. If you log in and want to access the database $session_max_duration seconds after you signed in, you will have to log in again... $session_max_duration=86400; # This value clean the session file about every day... |
log_archiving_duration |
To prevent the log files to grow too much, log_archiving_duration define the number of seconds for which a record remains in the log files. In other words, this defines the range of the backup in seconds: ex: $log_archiving_duration=86400*7; this would keep a track of change made during the last 7 days. |
enable_ip_check |
Set this variable
to 1 to enable IP check, 0 otherwise. So what should
you do? |
ip_log_restriction | This
variables enables ip based restriction at the login. For example, you might want to restrict the authorized IP address for the Administrator. The authorized IP are defined as regular expressions in the user_data table. |
cookie_session_check | This
variable enables cookie checks on every connection made with ezdb. Upon authentication, a session number is assigned to the user and carried on in the URL. When cookie checking is enabled, a second session number is sent to the user as a cookie and is controlled for each transaction. |
max_invalid_attempt | This
value block a user from being able to log in after x attempt. When a user is blocked, the Administrator (or any user being able to do updates on user_data) must reset the user's invalid attempt count to zero. Leave empty if you do not want to use this. |
password_expiration |
This variable defines the time a user
can use an account without updating his password. |
setup_on | This
variable enables the setup report (ezdb.cgi?setup) when set to 1 We suggest that you turn it off once your setup is ok. |
system_file_path | This is the path to the system database folder. Default value is ./system_db |
generic_html_file_path | This
is the path to the directory where the generic HTML files (ask_for_keywords.html,...)
are located. The default value is ./system_db_html |
default_html_template | This
is the HTML template used unless connected
for a database with a specific template (templates are replacing former html headers and footers). |
eztree_on | Set to 1 to enable EzTree use |
eztree_html_directory | The
path to the directory where the EzTree generated file should be located
('./my_html' by default) This directory should be http readable. |
eztree_data_directory | The directory path to the EzTree data file ('./my_db' by default) |
eztree_html_url | The url to the generated EzTree files. |
eztree_html_template | This defines the HTML template file used for the EzTree directory. This file should contain the special tag %%content%% that will be parsed and replaced by the EzTree content using the following content template: |
eztree_html_content | This file is the HTML content file used to shows the content of EzTree |
mail_from | The email address of the notifications sender |
mail_signature | The signature of the mail. |
mail_routine_path | The
complete path to the mail subroutine (EZDB was tested with sendmail only). Under NT, you suggest you use Blat. |
III How to Create a Database and Grant permissions:
If you are new to EZDB, we suggest that you
use the EZ Wizard to create your first databases.
1- Create a new database file:
Pretty easy: create a new text file, first line of which is:
pkey|field1|field2|... RETURN (-> new line)
- You can replace the pipe | by anything you
want...
- The first field must be pkey (Primary Key)
- YOU MUST PUT A CARRIAGE RETURN AT THE END
OF THE FIRST LINE
Make this file -rw-rw-rw- (chmod 666) and place it under the folder ./my_db
(this is the default user database folder, which can be changed: cf I).
Save it in UNIX MODE (to prevent from having junk ^M appearing after
transfer from DOS to UNIX).
Ex: Here is the database text file I call phone.csv
pkey|*date|name|phone|address|email|*owner|*group_owner|department|manager
(end_of_file you notice the newline caracter!)
Important Note: Special fields
*owner,
*group_owner
phone.csv
pkey|*date|name|phone|address|email|*owner|*group_owner|department|manager
You can use two specific fields to assign record ownership when ADDING
a new entry:
- The field *owner. This field will be automatically be replaced by the
login of the user creating the record.
- The field *group_owner. This field will be automatically be replaced
by the group of the user creating the record.
- You can call these field for read-only access with:
_*owner and _*group_owner (This
was changed in version 3.0)
~owner,
~group_owner
Same as *owner and *group_owner recording values when MODIFYING
a record.
These values are called like this in the display file:
_~owner and _~group_owner
*date, ~date:
Use
these fields to add time stamps to each record.
*date shows the date the record was created
~date shows the date the record was last modified
They will look like this: Tue Jul 25 21:24:15
2000
2- Define a database within EZDB with the 'tables' system database:
- Launch EZDB (You need to put the script on a server and run it from
a browser).
- Log in as Administrator (By default login: admin password: admin).
- Connect to tables.
- Add all required information:
Database name | this is the
alias followed by -- and then by the entire path of the flat file (with
extension and path): ex: phone--/usr/home/database/phone.csv |
Path to the HTML Display and Form File | HTML files location: this is the path to the HTML files for display (full and line mode, cf VII) and input (You can put them anywhere but specify the path correctly... cf IV for more info) |
Delimiter | the field
separator used in your flat database file Note: | will be translated into 'pipe' |
Path and URL of the Static Output directory | You can associate One (1) static file per record: specify here the server path to the directory storing these html files, and the URL to access these files through the web. |
Files' extension | It is possible to select the files extension, which allows for example to generate XML or WML files from your flat database |
Field used for files' name | Used
to name the output files using the name of one of the field. Note: The Static Output directory must be 666 and allow http access for the generated files. |
EzTree Fields | Specify
here which fields will be used in the eztree file. See discussion in the EzTree Chapter for more information Syntax: record_name--field1--field2 |
Path to the HTML Line Display File | Path of the HTML file used to display results in line mode (see Display Mode). |
Path to the No Match HTML File | Path of the HTML file used when no record match a query. |
Field displayed and Color used (Default Result Mode) |
This is for Default Display Mode Only. |
Search Result Mode | c.f. ch V and VII for detailed information |
Direct Full Display | When there is just one match for a search, EZDB can directly format the result (display phase) or present it with the regular search result interface (retrieve phase). |
Order By |
You can specify which fields will be used
for sorting the results in alphabetical order. Just enter a list of database
field separated by -- or a comma, |
Password protection field | One of the
database field used as a password to protect EACH record of a database. Ex: you could setup the 'nickname' field of the contact database to be used as a password protection for each contact. |
Bulk Delete | Set to Yes to enable bulk deletion of records: You do not have to display the records one by one to delete them if turned on. |
Mandatory Fields | Defines
fields that are required for insertion. Syntax: field1--field2--field3... |
Unique Constraint |
Defines uniqueness constraint for fields or group of fields. Syntax: field1+field2+field3+...--field11+field12+...--... Ex: Let's say you have a phone database:
you want the phone numbers to be unique (a phone number appears 1 time
only in the database) and you also want the couple of identifier (first_name,
last_name) to be unique. |
Bad Words Parsing |
This is used to block users from submitting unwanted words. Syntax: field1--field2--field3--...:bad_word1,bad_word2,... Ex: hobby--passion:iis,windows,asp |
File Upload |
EZDB allow automatic file upload. When you want to store files in your database, define the Target Directory where the files will be stored (this is the server path to this directory), the Target URL which is the URL used to access this directory through the web, and the Maximum File Size you authorize for files' upload. To use File Uploads, you must use this
form definition in your HTML form template: Ex: <input type="file" name="file_word_resume" value="_file_word_resume"> Note: The File Upload directory must be 666 and allow http readable access |
AUDIT Options |
You can keep track of every modifications
made to your databases. THIS FUNCTION IS ONLY ACCESSIBLE BY
ADMINISTRATOR. - We have then 4 options to define which
actions we want to trace: |
HTML Templates |
WARNING: The syntax has changed with the version 3.0. EZDB now uses a single template file containing the %%menu%% and %%content%% markers. You can use you own HTML template to customize the look of EZDB. The file is defined for each (context,phase) pair. Syntax: context--phase--template_path By default the template used is the default_html_template defined as a global variable. Ex: Note 1: Note 2: |
Email notifications |
The mail notifications are a list of values
SEPARATED BY CARRIAGE RETURN. *
(Always TRUE) OR (field_name=string)+
OR (field_name!=string)+ _GROUP_=manager->webmaster@dob.com->Manager Name:name+Problem description:pb_desc _LOGIN_!=default->me@here.net->Date:date+Email address:email *->me@here.net->Date:date+Email address:email->Something happened on the Job database |
MAIL TEMPLATES |
You can also use mail templates: Just
write a regular mail text and save it under mail_templates. Syntax: ((condition)+)->((email_address),)->(Template:filename) The Mail Template file MUST be under ./mail_templates (check that the directory exist and is readable). Ex: *->me@here.net->(Template:add_invoice.txt) Ex: In our invoice_add.txt template, we
use: |
3- Grant Group Permissions to access the table, Create Group Accounts:
The logic behind EZDB authentication and permissions management is fairly simple.
i- A user is defined in the
user_data system database: it is basically a combination of
profile name and login/password
ii- A Database is accessible by
groups of users.
At least 1 group should be able to access a
database: the administrator group admin_group.
If you need a
database to be accessible without Authentication, you need to
define how the default user group shall access the
database.
Groups access for a given database are defined in the
table_group system database.
In v 2.6+, any group named
"default..." is considered as a default group (it
doesn't need user's authentication for access):
it is the
multiple default access.
Iii- The fact that a user belong to a
certain group when accessing a given database is defined in the
user_rights system database.
iv- Note: All of the following
is true
A group is made of many users.
A user can belong to
many groups.
A group can be granted access to many databases.
A
Database can be accessed by many groups.
The combination of
(user,group, database) must be unique
Here is how you should define a group permissions
for a given database:
- Connect to table_group
- You first need to grant Administrator Permissions:
Database name | The table name! |
User Group | The user group! |
Permission | Authorized actions for that group on this database |
Menu | Visible menu options for that group on this database |
HTML Display | HTML
display file for that group on this database. (By default, the files specified in the "tables" database are used) |
HTML Form | HTML
form file for that group on this database (By default, the files specified in the "tables" database are used) |
HTML Template | HTML
Template file used to access the database for this group. By default, the files specified in the "tables" database is used. (The syntax is similar to the one used for the table definition.) |
Display Mode | Display mode for that group on this database |
Access Restrictions |
Defines restrictions depending on the value of certain fields: will block certain records from being accessed depending on the specified conditions. Syntax: ((context:(field_name=string)+);) String can be _LOGIN_ or _GROUP_ Important Note: |
Direct Full Display | Display mode when retrieving one (1) match for a query, for that group on this database |
Authorized Fields Restriction |
Defines which fields are allowed to be
submitted (leave blank otherwise). Block users from submitting unwanted
field values. |
Default Fields Values | Defines
default values for specified fields. Syntax: field1=value1--field2=value2--... |
Display Line HTML | Line Display file path for that group on this database |
Group allowed to use EzTree Assignment | Set this parameter to Yes to allow users to assign database records to the EzTree structure. |
- Repeat the following step for the default user group (group name is
'default').
- Repeat the following step for any group you want.
<<Top
IV
Create User Account and Group Assignment:
Once you
defined several user group for each table and gave them
permissions,
you have to create user accounts and to assign each
user to one group.
Follow these 2 steps:
1-
Create a User Account:
That's the role of the
user_data table.
This table contain every user account: name,
login, password.
- Connect to user_data:
- Fill up the
form: name, login and password.
- Submit
2-
Assign a User to a Group:
You remember that you
create group permissions for each table!
That's why you have to
assign each user to one group...
- Connect to user_rights
-
Put the login of the user, the table name, and the group this
user belong to FOR THIS TABLE!
Important
Note:
1- A USER CAN HAVE
GIVEN RIGHT FOR ONE TABLE AND OTHER RIGHTS FOR
ANOTHER TABLE
2-
IF A USER DOES NOT BELONG TO A GROUP FOR A GIVEN TABLE, HE IS
GRANTED DEFAULT PERMISSIONS FOR THIS
TABLE.
-----------------------------
Read this Example Carefully
-----------------------------------------
Ex:
Let's say you have two tables:
-
customer_table (3 groups: default, admin, representative)
- vendor_table (3 groups: default, admin, representative)
and a new user: John Doe.
1- You create an account for John Doe: you connect to user_data and
add him.
2- If you want
John to be able to use the vendor table with representative
right, you need to add the following to user_right table:
login: jdoe table: vendor
group: representative
3- With this
configuration John can access the vendor table with
representative right and the customer table with default
rights...
4- You can grant him Administrator permission towards the
customer
table: connect to
user_rights and enter John's login, the table name
(customer_table) and enter admin as group.
That's
it... He's now Administrator of the customer table.
5- If you want anything to happen, you have to define the right of
each
group (including default
group) versus each table:
> Connect to table_group
>
Give the proper right to the default group versus
customer_table
Define also
the HTML to use to access the database from this group
(by default, the HTML's defined in the "tables"
database )
> Repeat the
operation for each group versus customer_table
> Repeat the operation for
vendor_table
---------------------------------------------------------------------------------------------------------------
<<Top
V About HTML's:
Now you configured the rights, you need to create the HTML files allowing
you to "talk" to the database.
You need two HTML files: one to display records (read access), one to
enter records (write access).
You can use the HTML Autogenerate Function describe in chapter XII or
write manually each of these files.
1- An HTML file to display records:
Just create a usual HTML file. The EZDB program will read this HTML code
and replace every _fieldname with the value of the field:
ex: The phone Database is defined as following:
pkey|first_name|last_name|phone_no
Here is an example of simple HTML code you could use to display records:
<table>
<tr><td>First Name</td><td>_first_name</td></tr>
<tr><td>Last Name</td><td>_last_name</td></tr>
<tr><td>Phone No</td><td>_phone_no</td></tr>
</table>
When you retrieve a record from the database,
the program populate dynamically the fields.
This allows powerful connectivity to the database with DHTML, Cascading Style
Sheet...
Note: You should not use <html> and <body> tags as the result will be embedded in the html_ template_html
2- An HTML file to display Search Results: The LINE DISPLAY MODE:
This is used to show search results only (retrieve phase).
It is usually name database_line_display.html
It really works like the html_display file (ch VII 1-) with two difference:
You can have a link on each "short display" to the Full Display:
The href you have to use is _DETAIL_
Ex: <a href="_DETAIL_">View It</a>
Will be replaced by <a href="ezdb.cgi?product+search+display+90876876">View
It</a>
If you want to show the percentage of keyword found, put _PERCENTAGE_
in your HTML code and it will be replaced by the script by the proper value
Ex:
<form method=post action="_DETAIL_">
<input type=submit size=5 value="_PERCENTAGE_">
</form>
This would display a button showing the percentage of keyword
found
and linking to the Full record.
You can use 2 special variables in your line_display file:
_RECORD_COUNTER_ : this displays the number of matching corresponding to the query
_KEYWORD_ : this displays the keyword entered by the user.
v 3.0 and upper:
The line display file now supports <header>
and <footer> tags.
Ex:
<header>
Here is the search result
<br>
<table border=1>
<tr><td>Name</td><td>Phone</td></tr>
</header>
<tr><td>_name</td><td>_phone</td></tr>
<footer>
</table>
</footer>
This will display a table with 1 table line
per record.
3- An HTML file to input/modify records:
Here is the most sensitive part:
This HTML file is used to input data into the database when adding records
as well as retrieve and re-input when modifying (read-write access...).
Here is How it works: Be careful, it's CASE SENSITIVE.
* Define the form ACTION: it MUST be action="_CONTEXT_"
Here is an example of the syntax:
<form name="myform" method=post action="_CONTEXT_">
* Define the form SUBMIT button:
it MUST be <input type=submit value="Submit"
(any_javascript or whatever...)>
* Insert a text form object:
To connect a text input field to any field of the database, name the
form field "underscore field name":_name_of_the_dbfield
You can also use default values:
<INPUT type=text
name="field_name" value="(Default Value) _field_name">
Note: If you use a default value, the space before
_field_name is MANDATORY
Example: To connect to the first_name field of our phone database:
<INPUT
type=TEXT name="first_name" value="Your Name Here _first_name">
* Insert a textarea form object:
Here is the syntax:
<textarea
rows=2 cols=20 name=" _name_of_the_field">_name_of_the_field</textarea>
The textarea field must be named as the database field and the content
of the textarea must be "underscore db filed": for a field called
remark:
<textarea
rows=2 cols=20 name="remark">_remark</textarea>
* Insert a List form object (pop-down menu):
Syntax:
<select name="field_name">
<option>_L_field_name:option1</option>