Jump to content

PhCyber Tunnel Available!

Get it on Playstore
Download Now!

Ad Placement For Rent

Ad Space For Rent. Get Your Product up here and let our users see them first when they visit our Forum. We have thousands of page views everyday!
More Info
Info
  • Welcome to PhCyber
  • Explore and Enjoy Browsing!
  • Lots of useful topics
  • Stay active and receive prizes
Sign in to follow this  
Cyber

Captcha Image Verification

Recommended Posts

A good way to avoid automatic form submissions when creating a web form is to add some kind of verification. One of the best ways is to use an image verification, called also captcha. What it does is to dynamically create an image with a random string displayed on it. Then visitor is asked to type that string in a text field and once the form is submitted it checks if the string on the image matches the one inputted by the user. Because there is no easy way to read a text from an image (image recognition) this is a good way to protect your web forms from spammers.
For doing this CAPTCHA I would suggest using a session variable where you store the string generated and displayed on that dynamically generated image.

For Members Only. Register here https://phcyber.com/register



Save this code in a file called captcha.php. What this script does is to generate a random number from 10000 to 99999 and then assign it to $_SESSION['vercode']. Then it generates a 25x65 pixels image with black background and white text using size 14. So if you upload that captcha.php file on your web site and open

For Members Only. Register here https://phcyber.com/register
you will see an image displaying random integer. You will receive a new random integer every time you refresh that page.

Next we need to create our web form.

For Members Only. Register here https://phcyber.com/register



Above code will create a form with a single textarea box, randomly generated image using the captcha.php script and a text field where you will have to enter the verification code.

All we have to do now is to make the submit.php script which will check if the verification code you enter matches the one that has been randomly generated.

For Members Only. Register here https://phcyber.com/register

 


  • Heart 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...