I am trying to get this captcha working in the laravel framework. I want it to work with a contactus page but I have no clue how to implement the php section into the laravel framework as I am trying to put it in the post contact us function in the controller but it breaks my program
The Html in the view
<img id="captcha" src="/securimage/securimage_show.php" alt="CAPTCHA Image" />
<input type="text" name="captcha_code" size="10" maxlength="6" />
<a href="#" onclick="document.getElementById('captcha').src = '/securimage/securimage_show.php?' + Math.random(); return false">[ DifferentImage ]</a>
This code I am trying to get in the contoller:
include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';
$securimage = new Securimage();
if ($securimage->check($_POST['captcha_code']) == false) {
// the code was incorrect
// you should handle the error so that the form processor doesn't continue
// or you can use the following code if there is no validation or you do not know how
echo "The security code entered was incorrect.<br /><br />";
echo "Please go <a href='javascript:history.go(-1)'>back</a> and try again.";
exit;
}
Here is the : documentation https://www.phpcaptcha.org/documentation/quickstart-guide/