A Flat File Data Search



This is a Data Search on the Skywalker family from Star Wars


Select a character's name Select an event Select a location Select a description











The Data search commands


  • This is a basic ACII text file response, with a little bit of customisation, that searches files sequentially.
  • There are two secure file formats, 'comma separated' values, or 'tab separated' values. These are held in the 'secure' server sub-directory.
  • The Header Record contains the NAMES of the search fields ; the Data Records holds the data items for those search fields in cells.
  • There must be the same number of cells - so placing two commas beside each other will determine a 'blank cell'.
  • The first search field in the secure file must be unique [numbered], since the Data Search will point to these numbered 'addresses'.


  • Create a .txt file that lists a number followed by search field labels separated by commas ; below this, numbered sequentially, match the labels with data cell descriptions. Save this in the 'secure' sub-directory.



    Create a <FORM> .HTML page using the following script :

    <FORM METHOD="post" ACTION="http://home2.btconnect.com/natreed/cgi-bin/datasearch.cgi">
    <input type="hidden" name="DATA_FILE" value="/path/filename">
    <.... name="USER" value="URI"> ... where the 'URI' is the website address on the host server.
    <.... name="SEARCHFIELD:nn" value="01">
    <.... name="SEARCHTYPE:nn" value="CONTAINS">

    <input type="text" name="SEARCHTEXT:nn:M or O" size="10" maxlength="10"> ... where 'M' is a mandatory request, 'O' is optional ; and all the 'nn' values are the search fields, and should be the same number.

    <input type="submit" value="text message on button">

    </FORM>



    Customisation

    <SELECT NAME="...">
    <OPTION>
    ... are the basic commands to create a selection box.

    <input type="hidden" name="LOGIC" value="AND or OR"> .. the searching procedure, inclusive or exclusive ; defaults to 'or'.

    <... name="FIELD_DELIMITER" value="COMMA or TAB"> ... defaults to 'comma'.

    <... name="MAXNUMTOLIST" value="n"> ... number of search results presented.

    <... name="ADDITIONAL_TEXT" value="Y or N"> ... defaults to 'Yes'.

    <... name="DISPLAY_OUTPUT" value="HORZ or VERT"> ... horizontal or vertical ; defaults to vertical.

    <... name="FIELDSTODISPLAY" value="nn:nn:nn:..."> ... specifying an order to display the search results.

    <... name="BGCOLOR" value="colour"> ... specify a background colour.

    <... name="TEXTCOLOR" value="colour"> ... specify a text colour.

    <... name="TITLE" value="title"> ... specify a title text.

    <... name="HEADING" value="heading"> ... specify a text heading.

    These last four can be superceded by the following customising command :

    <... name="HEADER_TEMPLATE" value="HTML file"> ... an HTML file that is made up of an open HTML and BODY tag, with HEAD / TITLE tags, allowing the inclusion of conventional <BODY> commands.

    <... name="FOOTER_TEMPLATE" value="HTML file"> ... an HTML file that is made up of HTML commands, without any closing tags.

    <... name="RECORD_TEMPLATE" value="HTML file"> ... an HTML file that is made up of HTML commands, without any closing tags.

    These last three replace the previous customising scripts.




    Return to the main CGI examples page