|
The main disadvantage to the 'easy' method is that the information is sent via a normal e.mail, rather than via a CGI script. The results are not in the order you want them, unless you are really lucky and when the visitor clicks on the send button, a window pops up saying that the information is being sent via e.mail, are you sure you want to continue? This can put people off for some reason!
Anyway, here goes. First put the following in the <HEAD> section of your page:
<script>
<!--
/*By George Chiang (JK JavaScript site www.abstract.simplenet.com)
Credit must stay intact for use*/
var x
if (document.referrer=="")
x="unknown"
else
x=document.referrer
var inform="From url: "+x+" using browser: "+navigator.appName+" "+navigator.appVersion
//-->
</script>
As this script is used with the permission of the writer (George Chiang), you must retain the acknowledgement at the start of the script, don't worry it does not affect the function of the script and is invisible to the user.
Then you place the following in the <BODY> of your page where you want it to appear:
<table border="0" cellpadding="0" cellspacing="0" width="230" bgcolor="#FFFF00">
<tr><td align="center" valign="top"><font size="4">My Poll</td></tr></table>
<table border="0" width="230">
<tr><td><b>Do you think the internet should be censored?</b>
<form action="mailto:george@playful.com?subject=poll results" method="POST" enctype="text/plain" name="poll">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr><td valign="top" width="30%"><font size="4">Yes</font></td>
<td align="right" valign="top" width="30%">
<input type="radio" checked name="response" value="yes"></td>
<td align="right" width="40%"><script>
<!--
document.write('<input type="hidden" name="info" value='+'"'+inform+'">')
//-->
</script></td></tr><tr>
<td valign="top" width="30%"><font size="4">No</font></td>
<td align="right" valign="top" width="30%"><input type="radio" name="response" value="no">
</td>
<td align="right" width="40%"><input type="submit" name="B1" value="Submit!" style="background-color:yellow"></td>
</tr></table></form></td></tr></table>
...and you end up with this:
| Do you think the internet should be censored? |
The point here is that you can tailor you questions based on the previous pages, but instead of using a CGI host, just the the ordinary e.mail facility shown above.
If you click the 'submit' form an alert box will pop up and you will see what I mean by the warning.
DON'T FORGET - if you use this example, change the e.mail address (highlighted in red) to reflect your own e.mail address!
What happens when you have a form on your site and you want to be sure the entries are completed? You can do this by adding a 'form checker'. Click here to see how!
[1] [2] [3] [4] [5]
Top
<<< Previous page
|