FlexSearch Operations

FlexSearch supports four operations, so far we have seen only the Search operation.  Other FlexSearch operations include:

SendMail

The SendMail operation is extremely useful for getting responses from your web sites users.  Whether answers to questions, requests, orders or information updates.   With creative use of templates and forms, a user can select entries from the database and then e-mail their choices to a designated recipient.

SendMail only requires one field, SendMailNextPage, which tells FlexSearch what html file to display after the mail has been sent.  There many field that affect the how the mail is sent, but are not required:

Required fields, any field name that starts with "Required-" must contain a value on the form, if they do not then the error page will be displayed.

All remaining fields will be simply copied to the message. Here is an example and a sample of the received message:

<form method="POST" action="FlexSearch.cgi" align="center" enctype="multipart/form-data" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1">
  <input type="hidden" name="Operation" value="SendMail">
  <input type="hidden" name="Attach1" value="Image">
  <input type="hidden" name="SendMailNextPage" value="thankyou.html">
  <input type="hidden" name="SendMailSubject" value="Genealogy Information Update">
  <div align="center"><center>
  <table border="0" cellpadding="2" cellspacing="2">
    <tr>
      <th align="Right">Name:</th>
      <td><input type="text" size="40" maxlength="200" name="FullName"></td>
    </tr>
    <tr>
      <th align="Right">Date:</th>
      <td><input type="text" size="40" maxlength="200" name="EventDate"> </td>
    </tr>
    <tr>
      <th align="Right">Role:</th>
      <td><input type="text" size="40" maxlength="200" name="Role"> </td>
    </tr>
    <tr>
      <th align="Right">Event:</th>
      <td><input type="text" size="40" maxlength="200" name="EventName" > </td>
    </tr>
    <tr>
      <th align="Right">Location:</th>
      <td><input type="text" size="40" maxlength="200" name="Location" > </td>
    </tr>
    <tr align="center">
      <th align="right" height="25">Picture:</th>
      <td height="25" align="left"><input type="file" name="Image" size="28"></td>
    </tr>
    <tr align="center">
      <td align="right" height="25"><strong>Your Name:</strong></td>
      <td height="25" align="left"><input type="text" name="SendMailName" size="40"></td>
    </tr>
    <tr align="center">
      <td align="right" height="25"><strong>Your E-Mail:</strong></td>
      <td height="25" align="left"><input type="text" name="SendMailFrom" size="40"></td>
    </tr>
    <tr align="center">
      <th align="right" height="25">Message:</th>
      <td height="25" align="left"><textarea rows="5" name="Message" cols="38" wrap="virtual"></textarea></td>
    </tr>
  </table>
  </center></div><dl>
    <dd align="center"><div align="center"><center><p><input type="submit" value="Submit" name="B1"><input type="reset" value="Reset" name="B2"> </p>
      </center></div></dd>
  </dl>
</form>

Which looks like:

Name:
Date:
Role:
Event:
Location:
Picture:
Your Name:
Your E-Mail:
Message:

And comes back as an e-mail that looks like:


To: Admin@yourdomain.com
Date: Tue Jan 20 04:18:17 1998 GMT
From: "John Smith" <jsmith@somewhere.com>
Reply-To: jsmith@somewhere.com
Subject: Genealogy Information Update
X-Mailer: FlexSearch
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="----FlexSearchMessageBoundry"

FullName:	John Smith
EventDate:	September 1975
Role:		Groom
EventName:	Marriage
Location:	Las Vegas, NV

--------------------------------------------------------------------------
HTTP Referrer:    http://yourdomain.com/EventForm.html
HTTP User Agent: Mozilla/2.0 (compatible; MSIE 3.02; Update a; AOL 3.0; Windows 95)
Remote Host:     ww-te03.proxy.somewhere.com
Remote Address:  152.163.195.219
--------------------------------------------------------------------------

If on the other hand you do not like the simple form list of fields, you can use the "Template" form field to specify a template to be merged with the form fields to build a formated e-mail message, (see FormMerge below for more information).

Basically, this is just an example, you can do a lot more.

TemplateProcess

The TemplateProcess operation is useful for forms derived from other templates where record ids are available. Or for links where a record is not needed.   TemplateProcess requires a template, a datafile and a record to be merged.  Here is a sample link where a template will be merged without any search being performed:

   <a href="http://yourdomain.com/FlexSearch.pl?Operation=TemplateProcess&TemplateFile=car.html&DataFile=CarData.dat&Record_Number=1">
      Alternate Search
   </a>

The response on this type of link is faster because FlexSearch does not have to perform a query.  This link can actually generate specify multiple records by separating the record number by commas, however this would require that the template have a multi record block.

 

FormMerge

FormMerge is a simple version of TemplateProcess that treats all form fields on the submitting form as the selected datafile record.  This allow you to have one form which selects down as another.  You might use this to display a summary of selections from a larger form. 

Form Merge only requires on field, the name of a template.