org_heigl / contact
Contact-Form using a honeypot for spam-protection
1.0.1
2017-02-18 19:00 UTC
Requires
- php: ^7.0
- zendframework/zend-form: ^2.1 || ^3.0
- zendframework/zend-hydrator: ^2.1 || ^3.0
- zendframework/zend-inputfilter: ^2.1 || ^3.0
- zendframework/zend-mail: ^2.1 || ^3.0
- zendframework/zend-math: ^2.1 || ^3.0
- zendframework/zend-mvc: ^2.1 || ^3.0
- zendframework/zend-servicemanager: ^2.1 || ^3.0
- zendframework/zend-session: ^2.1 || ^3.0
- zendframework/zend-stdlib: ^2.1 || ^3.0
- zendframework/zend-validator: ^2.1 || ^3.0
- zendframework/zend-view: ^2.1 || ^3.0
Requires (Dev)
- mockery/mockery: ^0.9
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2024-11-23 10:25:30 UTC
README
This Modules provides a simple contact-form with spam-protection using a honeypot. It is based on the PhlyContact-Module by Matthew WeierOPhinney.
The idea of the honeypot is based on a blogpost by Lorna Jane Mitchell
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. :)
Installation
Install the package using composer.
composer require org_heigl/contact
Usage
- In your application.conf-file add the Module to the list of modules
return [ 'modules' => [ 'Org_Heigl\Contact', ] ]
- Configure your settings by copying the file
vendor/org_heigl/contact/config/module.org-heigl-contact.local.php.-dist
to your applicationsautoload
-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.
- Link to the Form using
$this->url('contact')
in your view. This will render the form in your view. - There is no step four.