|
General Details
|
|
PHP (Hypertext Preprocess...
|
|
Posted 208 Days Ago
|
|
359 Views
|
|
Received 3 Ratings
|
|
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. |
|
|
Glad you liked it, Ill change the double md5
|
|
|
$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
|
More "PHP (Hypertext Preprocessor)" Source Codes By This Author
Recently Posted "PHP (Hypertext Preprocessor)" Source Codes
Recently Rated "PHP (Hypertext Preprocessor)" Source Codes
|