authimg.php

来自「极限网络智能办公系统 Office Automation V3.0官方100%源」· PHP 代码 · 共 28 行

PHP
28
字号
<?php
 
session_start( );
header( "Content-type: image/PNG" );
srand( ( double )microtime( ) * 1000000 );
while ( ( $PASS_IMG_NUM = rand( ) % 10000 ) < 1000 )
{
}
$im = imagecreatetruecolor( 50, 20 );
$black = imagecolorallocate( $im, 0, 0, 0 );
$white = imagecolorallocate( $im, 255, 255, 255 );
$gray = imagecolorallocate( $im, 200, 200, 200 );
imagefill( $im, 30, 15, $gray );
imagestring( $im, 5, 8, 2, $PASS_IMG_NUM, $black );
$i = 0;
for ( ;	$i < 200;	++$i	)
{
	$randcolor = imagecolorallocate( $im, rand( 0, 255 ), rand( 0, 255 ), rand( 0, 255 ) );
	imagesetpixel( $im, rand( ) % 70, rand( ) % 30, $randcolor );
}
$PASS_IMG_NUM = crypt( $PASS_IMG_NUM );
if ( session_register( "PASS_IMG_NUM" ) == TRUE )
{
	imagepng( $im );
	imagedestroy( $im );
}
?>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?