Difference between revisions of "Web Hosting Feedback Script"
Hmckeon7644 (talk | contribs) (Web Hosting Feedback Script) |
|||
| (22 intermediate revisions by 3 users not shown) | |||
| Line 1: | Line 1: | ||
| + | == Feedback Script == | ||
| + | Schools who wish to allow users to leave feedback on their websites may use the supplied FormMail feedback script. This is as easy as copying the [[Web Hosting Feedback Script#Sample_HTML|sample HTML]] below into your page. This will send the feedback to the email address you specified in your [[Web Hosting Account Settings|Settings]]. Advanced users have the option of using the [[Web Hosting Feedback Script#Advanced Configuration Variables| Advanced Configuration]] variables if they wish. | ||
| + | |||
== NMS FormMail == | == NMS FormMail == | ||
[[Image:Nms.gif||right]] | [[Image:Nms.gif||right]] | ||
| Line 5: | Line 8: | ||
== Form Configuration == | == Form Configuration == | ||
| − | To make use of it, you need to write an HTML form that refers to the FormMail script. Here's an example which will send mail to the address | + | To make use of it, you need to write an HTML form that refers to the FormMail script. Here's an example which will send mail to the address you specified in your [[Web Hosting Account Settings|Settings]] when someone submits the form: |
| + | |||
| + | === Sample HTML === | ||
| + | |||
| − | < | + | <source lang="html4strict"> |
| − | <form method="post" action=" | + | <form method="post" action="/feedback/FormMail.pl"> |
| − | <input type=" | + | <table> |
| − | + | <tr> | |
| − | + | <td>Your name:</td> | |
| − | + | <td><input type="text" name="realname" /><font style="color: red;">*</font></td> | |
| + | </tr> | ||
| + | <tr> | ||
| + | <td>Your email address:</td> | ||
| + | <td><input type="text" name="email" /></td> | ||
| + | </tr> | ||
| + | <tr> | ||
| + | <td>Your feedback:</td> | ||
| + | <td><textarea name="feedback" cols="40" rows="5"></textarea><font style="color: red;">*</font></td> | ||
| + | </tr> | ||
| + | <tr> | ||
| + | <td colspan="2" align="center"><input type="submit" /></td> | ||
| + | </tr> | ||
| + | <tr> | ||
| + | <td colspan="2"> | ||
| + | <input type="hidden" name="subject" value="Feedback from your scoilnet Web Hosting form" /> | ||
| + | <input type="hidden" name="required" value="realname,feedback" /> | ||
| + | </td> | ||
| + | </tr> | ||
| + | </table> | ||
</form> | </form> | ||
| − | </ | + | </source> |
| − | + | This is how the form will appear on your site with the above code. | |
| + | [[Image:FormMail-screenshot1.png|frame|center|Sample FormMail]] | ||
| − | |||
| − | + | See how the hidden 'subject' input in the example above told formmail what to set the mail subject to? This is how almost all of formmail's advanced configuration works. Here's the full list of things you can set with hidden form inputs: | |
| − | + | == Advanced Configuration Variables == | |
| − | + | The settings below are recommended for advanced users only. | |
| − | |||
| − | |||
| − | |||
| − | |||
=== subject === | === subject === | ||
| Line 34: | Line 55: | ||
The subject line for the email. For example: | The subject line for the email. For example: | ||
| − | < | + | <source lang="html4strict"> |
<input type="hidden" name="subject" value="From the feedback form" /> | <input type="hidden" name="subject" value="From the feedback form" /> | ||
| − | </ | + | </source> |
=== redirect === | === redirect === | ||
| Line 42: | Line 63: | ||
If this value is present it should be a URL, and the user will be redirected there after a successful form submission. For example: | If this value is present it should be a URL, and the user will be redirected there after a successful form submission. For example: | ||
| − | < | + | <source lang="html4strict"> |
| − | <input type="hidden" name="redirect" value="http://www.your.domain/ | + | <input type="hidden" name="redirect" value="http://www.your.domain/thankyou.html" /> |
| − | </ | + | </source> |
If you don't specify a redirect URL then instead of redirecting formmail will generate a success page telling the user that their submission was successful. | If you don't specify a redirect URL then instead of redirecting formmail will generate a success page telling the user that their submission was successful. | ||
| Line 80: | Line 101: | ||
The target URL for a link at the end of the success page. This is normally used to provide a link from the success page back to your main page or back to the page with the form on. For example: | The target URL for a link at the end of the success page. This is normally used to provide a link from the success page back to your main page or back to the page with the form on. For example: | ||
| − | < | + | <source lang="html4strict"> |
<input type="hidden" name="return_link_url" value="/home.html" /> | <input type="hidden" name="return_link_url" value="/home.html" /> | ||
| − | </ | + | </source> |
=== return_link_title === | === return_link_title === | ||
| Line 88: | Line 109: | ||
The label for the return link. For example: | The label for the return link. For example: | ||
| − | < | + | <source lang="html4strict"> |
<input type="hidden" name="return_link_title" value="Back to my home page" /> | <input type="hidden" name="return_link_title" value="Back to my home page" /> | ||
| − | </ | + | </source> |
=== sort === | === sort === | ||
| Line 96: | Line 117: | ||
This sets the order in which the submitted form inputs will appear in the email and on the success page. It can be the string 'alphabetic' for alphabetic order, or the string "order:" followed by a comma separated list of the input names, for example: | This sets the order in which the submitted form inputs will appear in the email and on the success page. It can be the string 'alphabetic' for alphabetic order, or the string "order:" followed by a comma separated list of the input names, for example: | ||
| − | < | + | <source lang="html4strict"> |
<input type="hidden" name="sort" value="order:name,email,age,comments" /> | <input type="hidden" name="sort" value="order:name,email,age,comments" /> | ||
| − | </ | + | </source> |
If "order:" is used you must supply the names of all of the fields that you want to be in the body of the mail message. | If "order:" is used you must supply the names of all of the fields that you want to be in the body of the mail message. | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
=== required === | === required === | ||
| Line 120: | Line 132: | ||
If this is set, it must be a URL, and the user will be redirected there if any of the fields listed in 'required' are left blank. Use this if you want finer control over the the error that the user see's if they miss out a field. | If this is set, it must be a URL, and the user will be redirected there if any of the fields listed in 'required' are left blank. Use this if you want finer control over the the error that the user see's if they miss out a field. | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
=== email === | === email === | ||
Latest revision as of 11:37, 2 December 2008
Feedback Script
Schools who wish to allow users to leave feedback on their websites may use the supplied FormMail feedback script. This is as easy as copying the sample HTML below into your page. This will send the feedback to the email address you specified in your Settings. Advanced users have the option of using the Advanced Configuration variables if they wish.
NMS FormMail
NMS FormMail is a drop-in replacement for Matt Wright's FormMail script. It converts an HTML form submission to an email message.
Form Configuration
To make use of it, you need to write an HTML form that refers to the FormMail script. Here's an example which will send mail to the address you specified in your Settings when someone submits the form:
Sample HTML
<source lang="html4strict"> <form method="post" action="/feedback/FormMail.pl">
| Your name: | <input type="text" name="realname" />* |
| Your email address: | <input type="text" name="email" /> |
| Your feedback: | <textarea name="feedback" cols="40" rows="5"></textarea>* |
| <input type="submit" /> | |
<input type="hidden" name="subject" value="Feedback from your scoilnet Web Hosting form" />
<input type="hidden" name="required" value="realname,feedback" />
|
|
</form> </source>
This is how the form will appear on your site with the above code.
See how the hidden 'subject' input in the example above told formmail what to set the mail subject to? This is how almost all of formmail's advanced configuration works. Here's the full list of things you can set with hidden form inputs:
Advanced Configuration Variables
The settings below are recommended for advanced users only.
subject
The subject line for the email. For example:
<source lang="html4strict"> <input type="hidden" name="subject" value="From the feedback form" /> </source>
redirect
If this value is present it should be a URL, and the user will be redirected there after a successful form submission. For example:
<source lang="html4strict"> <input type="hidden" name="redirect" value="http://www.your.domain/thankyou.html" /> </source>
If you don't specify a redirect URL then instead of redirecting formmail will generate a success page telling the user that their submission was successful.
bgcolor
The background color for the success page.
background
The URL of the background image for the success page.
text_color
The text color for the success page.
link_color
The link color for the success page.
vlink_color
The vlink color for the success page.
alink_color
The alink color for the success page.
title
The title for the success page.
return_link_url
The target URL for a link at the end of the success page. This is normally used to provide a link from the success page back to your main page or back to the page with the form on. For example:
<source lang="html4strict"> <input type="hidden" name="return_link_url" value="/home.html" /> </source>
return_link_title
The label for the return link. For example:
<source lang="html4strict"> <input type="hidden" name="return_link_title" value="Back to my home page" /> </source>
sort
This sets the order in which the submitted form inputs will appear in the email and on the success page. It can be the string 'alphabetic' for alphabetic order, or the string "order:" followed by a comma separated list of the input names, for example:
<source lang="html4strict"> <input type="hidden" name="sort" value="order:name,email,age,comments" /> </source>
If "order:" is used you must supply the names of all of the fields that you want to be in the body of the mail message.
required
This is a list of fields that the user must fill in before they submit the form. If they leave any of these fields blank then they will be sent back to the form to try again. For example:
<input type="hidden" name="required" value="name,comments" />
missing_fields_redirect
If this is set, it must be a URL, and the user will be redirected there if any of the fields listed in 'required' are left blank. Use this if you want finer control over the the error that the user see's if they miss out a field.
If one of the things you're asking the user to fill in is their email address and you call that input 'email', formmail will use it as the address part of the sender's email address in the email.
realname
If one of the things you're asking the user to fill in is their full name and you call that input 'realname', formmail will use it as the name part of the sender's email address in the email.
