Coder Profile - Show off your skills, get a coder profile.
 
 
 
The Author
Relish
Mike
Send A Message
Rating
8.67
out of 10
( 3 Ratings )
Please login to rate source codes.

Click here to register a free account with us.
General Details
PHP (Hypertext Preprocess...
Posted 208 Days Ago
359 Views
Received 3 Ratings
More Codes By This Author
Prime Number Generator
Advanced Browser And Oper...
World Of Warcraft Data Ri...
Simple Hit Counter v1.3
Simple User Authenticatio...
Articles By This Author
Introduction To PHP

Simple User Authentication Image


Description
One day I needed an easy and simple verification script that creates an image with random numbers in it, and prompts them to type in the numbers in the image.

The script that I ended up with finds a random number, encrypts it, and stores it in a session so that you can compare it with the users input later. It is good for checking to see if the person signing up for a site is a person or a bot.

I will probably add on to it later, and make it so that you can add a background, and letters. Please let me know of any bugs.
Technical
Requires PHP 5

To install, paste this code into a PHP document, and name it what you want.

To display it, simply use the HTML image tag, and point to that PHP document.

<img src="phpcode.php">

To check if the user has entered the number shown in the image, use an if statement. Look at the source code below for an example.
Source Code
Comments
Please login to post comments.
 
Relish     Posted 90 Days Ago
 
 
Glad you liked it, Ill change the double md5
 
Binaries     Posted 90 Days Ago
 
 
$correctNum = md5($_SESSION['random_value']);
$_SESSION['random_value'] = md5($this->random);
You're encrypting the session twice, either remove the $correctNum and just
use the $_SESSION['random_value'] or encrypt the users input twice with
md5.

This went wonders on our site :D, works great :P
Page 1 of 1
More "PHP (Hypertext Preprocessor)" Source Codes By This Author
Recently Posted "PHP (Hypertext Preprocessor)" Source Codes
Recently Rated "PHP (Hypertext Preprocessor)" Source Codes
 
 
Part of the MyPingle Network
Development Blog :: Make A Donation :: Contact Me
Terms & Conditions :: Privacy Policy :: Documents
Version 1.44.00
Copyright © 2007 - 2008, Scott Thompson, All Rights Reserved