How To Make A One-Click Poll for Text Email
A normal poll in an email requires clicking on a link to
load a form on a web page. The form itself requires at
least two clicks, one for the answer choice and one to
submit it.
This article will describe how to publish a one-click poll
in your outgoing plain text (or HTML) email.
The one-click poll is created from an existing web page
form that would otherwise be used for that very same poll.
If you don't already have software that can handle a form
with a poll, two titles to consider are Master Survey and
Master Form V4.
The software that processes the poll form must be able
to process method="GET". Most do, but do test yours before
going to a lot of work creating a link you might not be able
to use. Simply change the form method to "GET" and try it.
If it works, smile. (Both Master Survey and Master Form V4,
mentioned above, process method="GET" as easily as they do
method="POST".)
The live one-click poll later in this article uses the
Master Form V4 CGI software.
A web page poll form is required to create the one-click
links. After the links are created, the form is no longer
required.
This is how it works. When someone clicks on a one-click
link:
-
The browser loads the page at the URL of the link.
-
The page redirects the browser straight to the
software the poll form would have used. (The form
is bypassed.)
The redirect URL is created with encoded information
generated by a previously submitted poll form. Thus,
the form itself can be bypassed.
Directions for creating the redirect URL are below.
-
The software processes the information in the
redirect URL just as if it had been submitted from
the poll form itself.
Two things are needed to create the one-click poll, a
redirect URL for each poll answer and a redirect page for
each URL.
The directions may appear somewhat confusing because there
are so many steps. Yet, they're mostly small steps.
When you do the steps once through, you'll realize how easy
it really is.
Let me provide an overview of the steps before you delve
into the nitty gritty:
-
To create a redirect URL, a copy of the current
poll form is modified to submit to itself. The
submission causes the URL in the browser's address
bar to change. And that URL is used to construct
the redirect URL.
-
To create a redirect page, paste the redirect URL
into the web page source code provided.
-
After the redirect page is uploaded, the one-click
link is the redirect page's URL.
Creating the Redirect URLs
First, make a copy of the poll form and use that. We don't
want to mess up the original.
In the poll form tag:
-
Change the method= attribute to "GET" (if it isn't
already).
-
Make a note of the URL in the action= attribute.
This is the URL of the form processing software and
will be used below. If it is not so already, make it
into an absolute http://... URL and test it to make
sure it's not a 404 "page not found." Then, delete
the entire action= attribute from the form tag.
Okay, now load the modified form into your browser. (It is
not necessary to upload this form.)
With the form loaded in your browser, we're ready to create
the redirect URLs. A redirect URL needs to be created for
each poll answer.
-
In the poll form, select or check one of the
answers.
-
Click the form's submit button.
-
The URL in the browser's address bar will change
when you click the submit button. Copy that new
URL and paste it into a plain text word processor.
-
Remove everything from the URL up to the first
question mark. (Keep the question mark.)
-
Insert the URL of the form processing software in
front of the question mark. (The URL of the form
processing software is the one you made a note of
before you removed the action= attribute from the
form tag.)
You now have a redirect URL for the poll answer.
-
Make a note of the redirect URL. You'll need it
later.
-
Do steps A through F for each answer in the poll
form.
You now have a redirect URL for each poll answer.
Creating the Redirecting Pages
The next thing to do is make a redirect page for each
redirect URL.
Here is the source code of a redirect page you may modify
for your use:
<html><head>
<meta http-equiv="refresh" content="0; URL=__________">
<script language="JavaScript">
window.location = "__________";
</script>
</head><body></body></html>
Replace the __________ in both places of the above source
code with one of the redirect URLs.
Make a redirect page for each redirect URL.
Test the redirect pages. They can be tested from your hard
drive be loading the pages into your browser, one at a time.
When a redirect page is loaded into your browser, you should
see whatever "thank you" page the software would normally
display if the actual poll form was used.
Creating the One-Click Links
When the redirect pages have been tested, upload them to
your server and make a note of their URLs.
The URLs of the redirect pages are your one-click links.
They are ready for publishing in text emails.
Example One-Click Poll
Here is a live example one-click poll with two possible
answers. Click on the link representing your preferred
color, red or blue.
I choose red. Red is nicer than blue: /library/demo/cgi/poll/red.html
I choose blue. Blue is nicer than red: /library/demo/cgi/poll/blue.html
Because the above are redirect pages, it may be impossible
to view the source code in your browser. The redirect URLs
are long, nearly 200 characters, too long to print here.
If you're curious, use Master Snooper
to see what the source
code looks like with the redirect URLs in place. Simply
provide the snooper with the one-click URL; it will grab
the page but ignore the redirect imperatives.
Question:
Did you find this article interesting and understandable? How can it be improved?
Your response is anonymous.
When done typing, click anywhere outside the box. [more info]
Will Bontrager
©Copyright 2006 Bontrager Connection, LLC Bontrager Connection, LLC
Please note:
Articles on this website are presented "as is". However -
If you have a question about a CGI script, HTML, CSS, PHP, or JavaScript
Ask one of our Experts and you'll have your answer!
Click here for details.