PHP good verification code

time:13-08-09 forum:PHP tools and code
  The verifying code reproduced from http://www.60ie.net/article/6/439.html

PHP actually has a lot of online, including a lot of mature classes, and the following is a very common PHP verification code, just to let the novice practice learning, the source code is not very complex, directly save it as.P HP, run, and the source of the practical way is very simple, is to judge whether the value of $_SESSION['yanzheng'] and the same as their own, if the same can be verified through, not very difficult principle, not much introduction, run to try it. The
PHP code

[code].Lt;? PHP
session_start ();
function rand_location () / / / / / / / > the number of 4 or so multiples of the difference is 20. Br / > static $rand=0;
$rand =20;
$location.#91; $i.#93; = $rand;
$i;} / >} / >} YuiopQWERTYUIOPASDFGHJKLMNBVCXZ';
for ($i = 0; $i.Lt; 4; $i)
{
$rand.#91; $i.#93; = $range{rand (0, 42)}; Ecolor (100, 30);
$bg = imagecolorallocate ($im, 180239,90);
imagefilledrectangle ($im, 0, 0, 150, 50, $bg);

0; 200. Tpixel ($im, Rand (1, 100), Rand (1, 30), $color);
}
* /

for ($i = 0; $i = 4; > {1, 255) / {1, 255} 10), Rand (80, 100), Rand (10, 30), Rand (0,90), Rand (0, 360), $color);


$location_x = rand_location (); / / / / / / / = = 0; 4 (178, 233), 46, 46, 46, 233); Imagettftext ($im, 20, Rand (0, 60), $location_x.#91; $i.#93; 27, $color,.Quot; C:\WINDOWS\Fonts\simhei.ttf.quot; $rand.#91; $i.#93;);
>;

prev:PHP upload file code, suitable for begin... next:Ji'nan scenic area take wedding photo ch...
post comment
Notice



approved   17 year old Chinese girls pass a com...   The great uncle of the dorm was atta...   The central government issued the me...   Ji'nan han zi donate marrow to save ...   One arm old man worked for 16 years ...
rand   Fast recording of Google /Baidu Ping...   The solution of PHP output random co...   For MySQL Illegal mix of collations ...   The difference between gbk_chinese_c...   PHP string intercept function substr...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com