One Communications KnowledgeBase One Communications KnowledgeBase
 



Main > Web Hosting
Minimize Text   Default    Enlarge Text

How do I set up a form on my web site that emails me the input fields?

Print
Save to list
E-mail
If your web site is hosted on the new linuxweb, please see the linuxweb FAQ: http://kb.onecommunications.net/index.php?article=252.

See formmail.cgi for complete details.
 
Here is a "bare bones" web form example that uses formmail, and will help you see the overall form and flow of information. To keep this simple, it has just one text input, plus the "Submit" and "Reset" buttons. The html looks like this (assumes you have placed a copy of formmail in the cgi-bin folder of your website, yourdomain.com):
 
<html>
 <head> 
  <title>Contact Us Form - Example </title> 
 <body> 
  <form name="form1" method="post" action="http://yourdomain.com/cgi-bin/formmail.cgi"> 
  <input type=hidden name="recipient" value="SomeOne@SomeWhere.net"> 
  Name: <input name="name" type="text"> 
  <p> 
   <input type="submit" name="Submit" value="Submit"> 
   <input type="reset" name="Submit2" value="Reset"> 
  </p> 
  </form> 
 </body>
</html>
 
(The 'title' and 'form name' are arbitrary. The email address is where you want the information sent.)
 
This code, when viewed in a browser, looks like this:
 
 
If "Bartholomew" is typed into the text input box and the Submit button is clicked, an email containing the information is sent to SomeOne@SomeWhere.net, as defined in the hidden recipient field. The email looks like this:
 
 Below is the result of your feedback form. It was submitted by
 () on Tuesday, January 20, 2004 at 14:35:54
------------------------------------------------------------------

name: Bartholomew

Submit: Submit

------------------------------------------------------------------ 

The browser returns a default page that looks like this:
 
 
 
Additional hidden fields may be included to customize formmail for your specific application. For a complete list of options, see formmail.cgi.




Related Articles
Unixweb ==> Linuxweb Migration FAQ
All One Communications web sites hosted on unixweb (@ and www records point to 64.65.215.10) will need to migrate to the newer, faster platform, Linuxweb.  The...
How do I create search pages on Windows shared web hosting?
One of the more common things to do to polish up a web site is to include a search function. One Communications' Windows shared web hosting uses the latest...
I always seem to run into problems while using a Macromedia product such as Dreamweaver or Contribute to upload files to One Communications web servers. Any suggestions?
If you experience problems while using a Macromedia product such as Dreamweaver or Contribute to upload files to One Communications, check the site definition.  ...
Powered by KnowledgeBuilder