AShop Customer Inquiry Form Setup Instructions

mailform.php uses the template mailform.tpl which must contain the email, firstname, lastname, subject and message fields but can also contain any number of other fields that will be added to the beginning of message like this...

<input type="text" name="extrafieldname" value="%extrafieldname%" size="20">
 
The "%extrafieldname%" code can be used to preserve the values if the form is submitted without the necessary fields: email and message, which will cause the script to display the form again. You should simply replace what's between the percent signs with the field name: %lastname% or %address%.
 
All extra fields that are submitted will be added to the message text.

It will check that the confirmed email matches the email field if a field named confirmemail exists or skip this step if it doesn't.

It will display a graphical security code that needs to be entered to submit the form. If the code is incorrect an error message will be displayed.

The template contains a few variables that look like this: %variable% They have the following purposes:

%errormessage% will be replaced with error messages if there are any.
%securityimage% will be replaced with an image tag that displays the security code
%securitycode% will be replaced with the random code that is used to generate and validate the security code

All other variables will be replaced with their corresponding value: %subject% = the value of the field "subject" if sent to the script. This can be used to keep the values of the form fields in case there 
is an error.

The messages that are submitted through the form are stored directly in the Sales Office inbox and are immediately available on the inquiries page.

It will work from any subdirectory of the AShop installation directory. You just need to copy the script and the files mailform.tpl and thankyou.html to the subdirectory to make it work. It will also display a validation message when the form is submitted without the necessary fields and use a standard subject ("Mailform message") when the subject field is missing.
