Using MailPost in a search page

  

We've added auto-replies and listbox URL redirection, now we've given MailPost the ability to handle universal search forms, like the one on Microsoft's site.

Below is an example of the type of search form you can create with MailPost.

  
  

Search for:

DejaNews Search DejaNews:

AltaVista Search the internet using AltaVista Lycos Search the internet using Lycos
Excite Search the internet using Excite Hotbot Search the internet using Hotbot
Info Search the internet using Infoseek Yahoo! Search the internet using Yahoo!
  
  

View the text file for this redirection.

View the source code of this form

  

Notes:

This form uses two new variable extensions, .URLencode and form. .

form. is used by MailPost for form variable value substitution. If you have two form variables, one named "A" and one named "B", and you give variable "A" a value of "form.B" then variable A will be given whatever value variable B has.

In this example, the dropdown list for DejaNews has been named "Site". The radio button for DejaNews has been named "*redirect*". Its' value has been set to form.Site. When the form is processed, if the DejaNews radio button is selected, the *redirect* variable (which is the radio button) will be given whatever value has been selected in the "Site" dropdown box. If the DejaNews radio button is not checked, one of the other radio buttons (which are all named *redirect* ) is selected, and then that radio button's value is passed into MailPost as the *redirect* value.

In order to tell MailPost to URL encode the variable SearchString, you must include a hidden variable with the same name as the search string (in this case the variable is named SearchString), and add the special extension .URLencode like SearchString.URLencode . Note: Any information that may contain spaces or special format characters (<,>,?,") and is to be passed back to any CGI via the URL must be encoded using the URLencode extension for proper operation.


 

Powered with MailPost

MailPost homepage

  
  

Here's the basic source code of the form above. We've removed all but the important tags to make the process easier to review.

  
<FORM ACTION="http://www.mcenter.com/cgi-shl/mailpost.exe/mailpost/samples/search/search.txt">

<INPUT TYPE="HIDDEN" NAME="SearchString.URLencode">

<P>Search for:  
<INPUT TYPE="TEXT" NAME="SearchString" SIZE="60">
</P>

<P>
<INPUT TYPE="RADIO" NAME="*redirect*" VALUE="form.Site"> 
Search DejaNews: 

<SELECT NAME="Site">
<OPTION VALUE="Dejanews-current" SELECTED="SELECTED">Current database</OPTION>
<OPTION VALUE="Dejanews-old">Old database</OPTION>
</SELECT> 

</P>

<INPUT TYPE="RADIO" NAME="*redirect*" VALUE="AltaVista" CHECKED="CHECKED">
<FONT SIZE="-1">Search the internet using AltaVista</FONT>

<INPUT TYPE="RADIO" NAME="*redirect*" VALUE="Lycos">
<FONT SIZE="-1">Search the internet using Lycos</FONT>

<INPUT TYPE="RADIO" NAME="*redirect*" VALUE="Excite">
<FONT SIZE="-1">Search the internet using Excite</FONT>

<INPUT TYPE="RADIO" NAME="*redirect*" VALUE="Hotbot">
<FONT SIZE="-1">Search the internet using Hotbot</FONT>

<INPUT TYPE="RADIO" NAME="*redirect*" VALUE="Infoseek">
<FONT SIZE="-1">Search the internet using Infoseek</FONT>

<INPUT TYPE="RADIO" NAME="*redirect*" VALUE="Yahoo">
<FONT SIZE="-1">Search the internet using Yahoo!</FONT>


<INPUT TYPE="SUBMIT" VALUE="Search Now">

</FORM>