📄 authimg.php
字号:
<?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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -