HOSTING SETTINGS
Standard Shared Hosting - CGI Web Forms
Please note: This web form service is provided totally without telephone support, all service queries are to be directed via email to support@izr.com. We will endeavour to provide as much support as possible however we are not a Web design company and therefore advise/support maybe limited.
The cgiemail cgi script gives website designers the ability to create html forms whos content can be emailed to a recipient. The cgiemail program requires two things.
- an html form.
This is a perfectly normal html form. - a text template.
This describes the format of the email message - who it is to and the subject.
The best way to explain the use of the above is by example:
I have a website http://www.mydomain.com and I want a form that
potential clients can fill in and return to me to request further
information. I want the URL for the form to be
http://www.mydomain.com/online/request.html and I want it to send the
compeleted forms to enquiries@mydomain.com.
Well lets start with the html form:
<html>
<title>
Request for further information
</title>
<body>
<form action="/cgi-bin/cgiemail/online/request.txt" method="POST">
<input name=success type=hidden id="success" value="http://www.mydomain.com/thanks.html">
Please supply us with your details:
<p>
Name: <input type=text name="name" size=25>
<p>
Company Name: <input type=text name="company" size=25>
<p>
Telephone No: <input type=text name="telephone" size=25>
<p>
Email Address: <input type=text name="email" size=25>
<p>
I would prefer contact by email
<input name="contact-by-email" type="checkbox" value="yes">
<p>
<input type=submit name="send" value="send">
</form>
</body>
</html>
A perfectly normal (and basic) html form. The form action is the
interesting part here. You can see it is calling the script /cgi-bin/cgiemail following that is the path to the text template that
formats this data and supplies it with address and subject. This path
was /online/request.txt - remember that we wanted the form to be in a
folder online . The template .txt file doesn't have to be in the same
folder as the html form, but it is tidier to keep them together. It
also does't have to have the same name - but again this is neater. If
you were to change the name or path to the template you would have to
reflect that in the path passed after /cgi-bin/cgiemail. You can also see that when the form is completed successfully the customer is redirected back to a page of your choice.
Now we will have a look at the text template:
To: enquiries@mydomain.com
Subject: Request for further information Name: [name]
Company Name: [company]
Telephone No: [telephone]
Email Address: [email]
Contact by email ? [contact-by-email]
As you can see the template is quite simple. There are a number of things to point out here: The To: must be on the first line of the
template.
The space between the Subject: and the body of the message is
important.
The data from the html form is substituted into the [field] tags. The
html name matching the one within [] .
The message received is this:
Subject: Request for further information
Date: Wed, 9 Dec 1998 10:53:50 GMT
From: izR Solutions Web Server
To: enquiries@mydomain.com
Name: John Smith
Company Name: Megadodo Publications
Telephone No: 1234 123456
Email Address: john@megadodo.corp
Contact by email ? yes

