Ajax Fancy Capture in CakPHP
- by Constantin.FF
I have found a nice ajax capture which i would like to use in a CakePHP framework website.
The plugin can be found here: http://www.webdesignbeach.com/beachbar/ajax-fancy-captcha-jquery-plugin
What I have tried:
in the controller:
public function index($slug = null, $capture = false) {
if($capture AND $capture =="get_capture"){
$rand = rand(0,4);
$_SESSION['captcha'] = $rand;
echo $rand;
die;
}
if (!empty($this->data) && $_POST['captcha'] == $_SESSION['captcha']) {
.... save the post
}
}
in the view:
$selectURL = " $(function() {
$('.ajax-fc-container').captcha({
borderColor: 'silver',
captchaDir: 'http://localhost/img/capture',
url: 'http://localhost/contacts/index/contacts/get_capture',
formId: 'MessageIndexForm',
});
});";
$this->Html->scriptBlock($selectURL, array('inline' => false));
also I have tried with url: 'http://localhost/js/capture.php'
which is the original file coming with the plugin but still not working.