Simple FormMail script example چاپ

  • 0

Simple FormMail script example




The following is the simplest possible example of a web-based form which is designed to use the preinstalled FormMail script available on all of our servers in the global cgi-sys directory.

This particular form is just a sample of a script which would be something one might want to use for a newsletter or mailing list signup form where the only input necessary is a visitor's email address:

 


[email protected]
">


http://x.com/thanks.html">
Enter your email address to sign up for our newsletter!


 

The code above would result in this simple form:

If desired the form above can be copied and used as is (or with any modification you wish) changing only the items in blue. Enter your own email address in the recipient field and the URL you wish to have users redirected to after successfully completing your form.

While the URL used in the redirect tag can reference an existing page (your index page for example) a nice touch in such situations is to direct users to a thank you message with a link back to your index page. If you create a file using the following code, name it thanks.html and place it in your public_html directory all you would have to change in the redirect tag in the form above is the "x.com".



Thanks for signing up!



Thanks for signing up for our newsletter!


go back to our main page



 

Things To Note

- in this particular sample form I specifically named the name of the text input "e_mail" so that the email addresses of those submitting via the form will appear in the message body of the emailed output. If you prefer to receive an email with a blank message body and the submitter\'s email address inserted in the From: field of the email just change "e_mail" to "email"

- I included the "required" variable for e_mail in order to insure that no email will be sent unless text is entered into the form. If this isn't an issue the line containing "required" can be omitted.


آیا این پاسخ مفید بود؟

« بازگشت