The redirection feature adds a new way to use MailPost. This feature allows you to add those dropdown list boxes for URLs that seem to be so popular these days.
This was accomplished by first creating the list box in the form. We set the name of the listbox to *redirect* (this tells MailPost that this is to be used with redirection. All of your redirection listboxes will be named *redirect*).
Next, we edited the listbox. We placed what we wanted the user to see in the option's TEXT "setting". We placed the value that we'll use with MailPost in the option's VALUE setting.
<SELECT NAME="*redirect*" SIZE="5"> <OPTION VALUE="MailPost Homepage" SELECTED="SELECTED">MailPost Homepage</OPTION> <OPTION VALUE="--- --- ---">--- --- ---</OPTION> <OPTION VALUE="Test MailPost">Test MailPost</OPTION> <OPTION VALUE="--- --- ---">--- --- ---</OPTION> <OPTION VALUE="MailPost Help">MailPost Help Pages</OPTION> </SELECT>
Next, we edited a text file that we named redirect.txt to include these 3 URLs
MailPost Homepage || http://www.mcenter.com/mailpost/ Test MailPost || http://www.mcenter.com/mailpost/sample.html MailPost Help || http://www.mcenter.com/mailpost/help/
The format of the file to use with the redirection feature is simple.
You place the VALUE of the listbox's option followed by a space, two "|"
(sometimes called a pipe or bar) and another space, and then the URL to
send the user to.
Note: the redirect feature is case sensitive!! The text in your
option's VALUE setting must match exactly the text in the text file.
MailPost Help is NOT the same as MAILPOST Help.
The part of our text file (which we named redirect.txt) that works with these option values looks like this:
MailPost Homepage || http://www.mcenter.com/mailpost/ Test MailPost || http://www.mcenter.com/mailpost/sample.html MailPost Help || http://www.mcenter.com/mailpost/help/
After this, we set the form's action to call MailPost as we normally do.
Only this time, we specify the text file to use for the redirection,
instead of a template file. In our case, this file is called "redirection.txt."
Note that you can have multiple files that you can use with the
redirection feature. You could have all of your URLs listed in just one
file, which would make URL updates much easier, instead of changing
numerous text files. It's really up to you to decide if you'll use one
single file, or multiple files. Be aware that we do have a 30k limit on
these files.
So, for this example, our form's ACTION is set to:
ACTION="http://www.mcenter.com/cgi-win/mailpost.exe/mailpost/samples/redirect/redirect.txt"
If you decide you don't want to use files to store your URLs for redirection, you can use MailPost with URLs that reside in your HTML code instead of a template file. If you configure MailPost for this, remember that anyone from anywhere can use MailPost on your webserver to run redirections on, thus using your resources to operate their service.
To configure MailPost to do this, the Allow_HTML_Redirection item under [serverconfig] of the mailpost.ini file which is located in your webserver's directory must be set to 'yes' . Next, set your form's action to call MailPost without a template file:
ACTION="http://www.mydomain.com/cgi-shl/mailpost.exe"
Next, in your form, set the VALUE of your variables to the URL of the webpage you want the user to be sent to:
<FORM ACTION=""http://www.mydomain.com/cgi-shl/mailpost.exe"> <SELECT NAME="*redirect*" SIZE="5"> <OPTION VALUE="http://www.mcenter.com/mailpost/" SELECTED="SELECTED">MailPost Homepage</OPTION> <OPTION VALUE="--- --- ---">--- --- ---</OPTION> <OPTION VALUE="http://www.mcenter.com/mailpost/sample.html">Test MailPost</OPTION> <OPTION VALUE="--- --- ---">--- --- ---</OPTION> <OPTION VALUE="http://www.mcenter.com/mailpost/help/">MailPost Help Pages</OPTION> </SELECT> </FORM>
We advise that if you use the redirect feature, that you make one item in your list the "default" for that list. If no "default" is specified, MailPost will return an error message that would not make sense to your users.
If you include "placeholders" in your pulldown list (like "--------" or a bunch of spaces) MailPost will redirect the user back to the HTTP_REFERER page.