The verification code is implemented without the GD Library. What is the verification code when the GD library is not required? Php (as the mainstream development language) + ------------------------------------------------- | * file validate_image.php (as the current verification code without the GD Library)
// + -------------------------------------------------
// | * File validate_image.php (as the mainstream development language)
// | * Function to implement the website login verification code
// | * Version 1.0.0
// | * Date: 2005-4-1
// | * Author: QQ 500784 cokeyang at hotmail.com
// | * Copyright http://www.adibaby.com [temporarily closed]
// | * Usage:
// | Some images can be prepared in the GD Library in advance. the GIF format, file name, and image are recommended.
// | The numbers in the image are the same. put the image in a folder. Set the data in CONFIG.
// | Reference
// | Verification page Comparison
// | $ _ COOKIE [validate] = md5 ($ _ POST [input])
// | ============================== Config start ============================ =
$ Image_path = "numimage"; // The image file path is not followed/
$ Image_ext = "gif"; // image file extension
// ================================== Config end ========================== ====
$ Imagelist = array ();
If ($ handle = opendir ($ image_path )){
While (false! ==( $ File = readdir ($ handle ))){
$ Filename = explode (".", $ file );
$ Imagelist [] = $ filename [0];
Unset ($ filename );
}
Closedir ($ handle );
Unset ($ imagelist [0]);
Unset ($ imagelist [1]);
}
Srand (float) microtime () * 103E // | reference
// | Verification page Comparison
// | $ _ COOKIE [validate] = md5 ($ _ POST [input])
// | ============================== Config start ============================ =
$ Image_path = "numimage"; // The image file path is not followed/
$ Image_ext = "gif"; // image file extension
// ================================== Config end ========================== ====
$ Imagelist = array ();
If ($ handle = opendir ($ image_path )){
While (false! ==( $ File = readdir ($ handle ))){
$ Filename = explode (".", $ file );
$ Imagelist [] = $ filename [0];
Unset ($ filename );
}
Closedir ($ handle );
Unset ($ imagelist [0]);
Unset ($ imagelist [1]);
}
Srand (float) microtime () * 10000000 );
$ Filename = $ imagelist [array_rand ($ imagelist)];
Setcookie ("validate", md5 ($ filename ));
Header (Content-type: application/. $ image_ext );
Echo implode (, file ($ image_path. "/". $ filename. ".". $ image_ext ));
?>
Why? Php (as the mainstream development language) // + --------------------------------------------------- // | * file validate_image.php (as the current...