Git Product home page Git Product logo

phpcaptcha's Introduction

phpcaptcha

Maintainer Contact

Old Version:

  • Saophalkun Ponlu <phalkunz (at) silverstripe (dot) com>

  • Will Rossiter <will (at) fullscreen (dot) io>

This Version:

  • Davis Dimalen <davis (at) webtorque (dot) com>

This is an old module originally developed for 2.3. I had to do some minor tweaks to make it compatible with 3.0.5. Unlike Captcha by google, phpcaptcha is easier to read and simple which means it is client friendly.

The original module can be downloaded from http://www.silverstripe.org/phpcaptcha-module/

SS Version Requirements

3.0.5

Installation Requirements

  1. Download the Spam Protection module (http://www.silverstripe.org/spam-protection-module/)
  2. Save it in your project root folder
  3. Download this module and save it on your project root folder

How to use

You can add a phpcaptcha field to your form by adding it to your FieldList. Example:

You can add the following snippet to your Controller (example Page_Controller).

public function SampleForm() {

$fields = FieldList::create(
	TextField::create('Amount', 'Amount (Testing Only):*')->setAttribute('placeholder', 'Amount'),
	TextField::create('FirstName', 'First name:*')->setAttribute('placeholder', 'First Name'),
	TextField::create('LastName', 'Last name:*')->setAttribute('placeholder', 'Last name'),
	EmailField::create('Email', 'Email:*')->setAttribute('placeholder', 'E-mail'),
	new PhpCaptchaField('Captcha', "Prove you aren't a Robot (enter the characters to the following field):*")
);

$validator = RequiredFields::create(array('FirstName', 'Amount', 'LastName'));
$actions = FieldList::create(FormAction::create('processSampleForm', 'Submit Sample'));

return new Form($this, 'SampleForm', $fields, $actions, $validator);

}

public function processSampleForm($data, Form $form){ // $data contains values from the SampleForm form fields. // Process your data here

Debug::dump($data);

return null;

}

phpcaptcha's People

Contributors

sktzoootech avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.