2017 © Pedro Peláez
 

library contact

Contact-Form using a honeypot for spam-protection

image

org_heigl/contact

Contact-Form using a honeypot for spam-protection

  • Tuesday, February 21, 2017
  • by heiglandreas
  • Repository
  • 2 Watchers
  • 4 Stars
  • 180 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 18 % Grown

The README.md

Org_Heigl\Contact

Build-Status Coverage Status Scrutinizer Code Quality Code Climate Codacy Badge SensioLabsInsight, (*1)

Latest Stable Version Total Downloads License composer.lock, (*2)

This Modules provides a simple contact-form with spam-protection using a honeypot. It is based on the PhlyContact-Module by Matthew WeierOPhinney., (*3)

The idea of the honeypot is based on a blogpost by Lorna Jane Mitchell, (*4)

The contact form is for example used at php.ughttps://php.ug/contact) and so far I haven't had spam from it in over 4 years. So the honeypot seems to be working. :), (*5)

Installation

Install the package using composer., (*6)

    composer require org_heigl/contact

Usage

  1. In your application.conf-file add the Module to the list of modules
    return [
         'modules' => [
             'Org_Heigl\Contact',
         ]
    ]

  1. Configure your settings by copying the file vendor/org_heigl/contact/config/module.org-heigl-contact.local.php.-dist to your applications autoload-folder (removing the .dist on the way) and then altering the content.
    return [
        'OrgHeiglContact' => [
            'mail_transport' => [
    //           'class'   => 'Zend\Mail\Transport\Smtp',
    //           'options' => [
    //               'host'             => 'localhost',
    //               'port'             => 587,
    //               'connectionClass'  => 'login',
    //               'connectionConfig' => [
    //                   'ssl'      => 'tls',
    //                   'username' => 'contact@your.tld',
    //                   'password' => 'password',
    //               ],
    //           ],
                 'class'  => 'File',
                 'options' => array(
                     'path' => sys_get_temp_dir(),
                 ],
            ],
            'message' => [
                 // These can be either a string, or an array of email => name pairs
                'to'     => 'contact@your.tld',
                'from'   => 'contact@your.tld',
                // This should be an array with minimally an "address" element, and
                // can also contain a "name" element
                'sender' => array(
                    'address' => 'contact@your.tld'
                ],
            ],
        ],
    ]

For the mail_transport-settings you may want to have a look at Zend\Mail., (*7)

  1. Link to the Form using $this->url('contact') in your view. This will render the form in your view.
  2. There is no step four.

The Versions

13/09 2015

dev-phpug

dev-phpug http://github.com/heiglandreas/OrgHeiglContact

Contact-Form using a honeypot for spam-protection

  Sources   Download

MIT

The Requires

 

form contact spam honeypot