Skip to content

A 1-page contact form that prevents spam, supports dynamic recepients, auto replies, has dark mode, can log, and more.

License

Notifications You must be signed in to change notification settings

lwcorp/antispam-contact-form

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Installation

  1. Edit the PHP file to reflect basic settings like the address/adresses that should get the mail
  2. Run the HTML file

Features

  1. Just 1 page for client (HTML) and 1 page for server (PHP)
  2. Every form field can either be GET or POST
  3. Triple mode for errors and success - they can be presented right in the form itself, in a blank page or redirect to external pages
  4. Dual mode for results - they can be either sent, logged or both
  5. The form can be limited to be used in specific domains only
  6. Auto reply can be sent automatically
  7. The client side uses HTML5 to check for required fields, but the server side can check them too for a double verify

image

Advanced

Server

The configuration file can be used to:

  1. Limit the domains that can use the form
  2. Enable logging
  3. Define auto reply
  4. Define required form fields (in case the user tricked the client side)

Client

You can optionally include these special fields (not having to be hidden, of course):

<input type="hidden" name="redirect" value="false">`

Errors and success will appear right in the form itself slowing down the user by redirecting. Use true to make them appear in another page.

<input type="hidden" name="sendto" value="X">
<!-- or -->
<input type="hidden" name="sendto" value="X,Y,Z">

Mention numbers of recpients that should get the results, whereas only the server can know the addresses behind those addresses.

<input type="hidden" name="return_link_url" value="javascript:window.close()">

Mention a page's URL to link to in case of success:

<input type="hidden" name="return_link_title" value="Close this window">

Mention a page's title to link to in case of success:

<input type="hidden" name="errorpage" value="https://...">

Mention an error page that will always be redirected to on errors.

<input type="hidden" name="successpage" value="https://...">

Mention a success page that will always be redirected to on errors.

<input type="hidden" name="required" value="subject,email">

Ask the server to also check if these fields were filled on top of what the server was already defined to check.

About

A 1-page contact form that prevents spam, supports dynamic recepients, auto replies, has dark mode, can log, and more.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published