[plug] html FORM - help desired

Matt Kemner zombie at networx.net.au
Thu Jul 23 13:49:38 WST 1998


On Thu, 23 Jul 1998, Lindsay Allen wrote:

> A school which I support in a minor way has an html form which it wants to
> be available on its web page.  The form has input for name and address etc
> etc and the idea is that it arrives at the school somewhere.
> 
> I have no knowledge of this sort of thing, though I would presume that
> there would be an sql database involved somewhere.

Not necessarily - only if you want the statistics to be added to a
database.  The easiest way is to use a script such as "Formmail.pl" which
you can post an html form to, which it then mails to the specified email
address.

If you can't find Formmail anywhere, let me know and I'll stick it on an
ftp site somewhere. Then create a HTML page such as:

<HTML>
<HEAD><TITLE>Sample Entry form</TITLE></HEAD>
<BODY>
<FORM action="http://YOUR.WEB.SERVER/cgi-bin/Formmail.pl" method="POST">
  <INPUT type="hidden" name="recipient" value="SCHOOL'S EMAIL ADDRESS">
  <INPUT type="hidden" name="subject" value="Online Entry Form">
  Enter your name:<input type="text" size="40" name="realname"><BR>
  Enter your Email: <input type="text" size="40" name="email"><BR>
  Enter your Address:<input type="text" size="40" name="address"><BR>
  Enter your Suburb:<input type="text" size="40" name="suburb"><BR>
  Enter any additional comments you may have:<BR>
  <textarea name="comments" rows="10"
    cols="40" wrap>Just write something here</textarea><P>
  <input type="submit" value="SEND">
  <input type="reset" value="RESET">
</FORM>
</BODY>
</HTML>

You can also add checkboxes with:

    <B>Sample Checkbox1:</B> <input type="checkbox" name="checkbox1"><BR>
    <B>Samble Checkbox2:</B> <input type="checkbox" name="checkbox2"><BR>

And radiobuttons with:

    one:<input type="radio" name="radio1" value="one">
    two:<input type="radio" name="radio1" value="two">
    three:<input type="radio" name="radio1" value="three"><BR>
    A:<input type="radio" name="radio2" value="A">
    B:<input type="radio" name="radio2" value="B">
    C:<input type="radio" name="radio2" value="C">
 
Formmail then sends an email to "recipient" with from address as whatever
they filled in in the email textbox, and with "realname" as their name,
with subject as what you've put in the "hidden" field of "subject"

You then get "Below are the results of your feedback form"

comments: Just write something here
radio1: two  -- this shows which radio button they've selected
checkbox2: on -- this shows that they put a tick in checkbox2

and you get results of the other entries as well.

You can even sort the results in the order you prefer by adding a tag such
as <INPUT type="hidden" name="sort" value="realname,email,address,suburb">
- include all the fields you want to see results for, and don't leave any
spaces anywhere in the "value" field above.

Hope this helps you on your way.. Any more questions, send them this way..

 - Matt



More information about the plug mailing list