The realization of a PHP script authentication cod
2016-08-23
0 0 0
no vote
Other
Earn points
<?
// File 7-26-shoing.php: generates CAPTCHA image, and output
session_start (); // start session
header ('Content-type: image / gif'); // output header information
$ image_w = 90; // verification code pattern width
$ image_h = 25; // verification code graphics high
$ num = range (0,9);
$ string = ""; // initialize
$ len = count ($ num); // length of the new array
for ($ i = 0; $ i <4; $ i ++)
{
$ new_num [$ i] = $ num [rand (0, $ len-1)]; // in $ result array randomly remove four characters
. $ string = $ string $ new_num [$ i]; // generate the verification code string
}
$ _SESSION ['String'] = $ string; // use $ _SESSION variable by value
$ image = imagecreatetruecolor ($ image_w, $ image_h); // Create a picture object
$ white = imagecolorallocate ($ image, 255, 255, 255);
$ pt_color = imagecolorallocate ($ image, mt_rand (0,255), mt_rand (0,255), mt_rand (0,255)
// File 7-26-shoing.php: generates CAPTCHA image, and output
session_start (); // start session
header ('Content-type: image / gif'); // output header information
$ image_w = 90; // verification code pattern width
$ image_h = 25; // verification code graphics high
$ num = range (0,9);
$ string = ""; // initialize
$ len = count ($ num); // length of the new array
for ($ i = 0; $ i <4; $ i ++)
{
$ new_num [$ i] = $ num [rand (0, $ len-1)]; // in $ result array randomly remove four characters
. $ string = $ string $ new_num [$ i]; // generate the verification code string
}
$ _SESSION ['String'] = $ string; // use $ _SESSION variable by value
$ image = imagecreatetruecolor ($ image_w, $ image_h); // Create a picture object
$ white = imagecolorallocate ($ image, 255, 255, 255);
$ pt_color = imagecolorallocate ($ image, mt_rand (0,255), mt_rand (0,255), mt_rand (0,255)
php
脚本
实现
验证
Related Source Codes
CRMEB open source mall system (including h5 offici
0
0
no vote
Verification code identification
0
0
no vote
PHP source code of CRMEB multi port and multi lang
0
0
no vote
ALLLIGHT music player, adaptive to all mobile phon
0
0
no vote
DSMALL multi-merchant mall system
0
0
no vote
No comment