Simple Captcha system in php

banner captcha

Hey, guys, I’m back with another tutorial on how to make a captcha system in PHP to make our own captcha code image to verify that the form is filled by a person and not by a bot. captcha is a very good way to secure our form because in this way we protect our forms from CSRF attack because every time there is a random code generated and the user has to fill it otherwise form will not submit.

Download Demo

So let’s get started,

What is Captcha System?

It is a system in which there is an image generated containing a random code using PHP RAND() function and there is a field asking for that code, so when user fill the correct code as shown in the image in the input field the form is submitted otherwise not.

So the codes for this captcha is given down below.

Here is the Index.php page –

and here is the Generate.php Page which generate the random code and put it in a image using imagecreate() function.

So that’s a rap for this tutorial and i see you next time.

Peace