세션 오류
富贵
富贵 2017-09-29 21:48:29
0
3
1517

<?php

session_start();

$str = '';

$width = 300;

$height = 100;

$img = imagecreatetruecolor($width,$height);

$ 흰색 = imagecolorallocate($img, 255, 255, 255);

$red = imagecolorallocate($img, 255, 0, 0);

imagefilled직사각형($img, 0, 0, $width, $height, setColor( $img));

function setColor($img)

{

return imagecolorallocate($img,getColor(),getColor(),getColor());

}

function getColor()

{

return mt_rand(0,255);

}

function setNum($a,$b)

{

return mt_rand($a,$b);

}

function getCode()

{

return $string = Join('',array_rand(array_flip(array_merge(range(0,9),range('a','z'),range('A','Z'))),4));

}

$str = getCode();

for($i=0;$i<4;$i++)

{

$size = setNum(20,50);

$angle = setNum(-15,15);

$x = ($width/4)*$i+mt_rand(1,9);

$y = mt_rand(($height/2),$height);

$color = setColor( $img );

$fontfile = './fonts/MSYH.ttf';

$text = mb_substr($str,$i,1,'utf-8');

imagettftext($img, $size, $angle, $x, $y, $color, $fontfile, $text);

}

for($i=0;$i<1500;$i++)

{

imagesetpixel($img, mt_rand(0, $width), mt_rand(0, $height), setColor($img ));

}

for($i=0;$i<3;$i++)

{

imageline($img, mt_rand(0, $width), mt_rand(0,$height), mt_rand (0, $width), mt_rand(0,$height), setColor($img));

}

for($i=0;$i<3;$i++)

{

$cx = mt_rand(0, $width);

$cy = mt_rand(0, $height);

$width = mt_rand(0, $width/2);

$height = mt_rand(0, $height/2);

$start = mt_rand( 0, 360);

$end = mt_rand(0, 360);

$color = setColor($img);

imagearc($img, $cx, $cy, $width, $height, $start, $end, $color);

}

$_SESSION['verifycode'] = $str;

header('content-type:image/jpeg');

imagejpeg( $img );

imagedestroy( $img );

? >


富贵
富贵

모든 응답(3)
寻觅 beyond

그림의 특정 단계에 문제가 있어서 생성된 무작위 4개의 캐릭터가 성공했을 것입니다

林

적어도 오류 보고 내용은 함께 보내주세요. 그렇지 않으면 어떤 오류를 보고했는지 어떻게 알 수 있나요?

直奔十维

이유를 모르겠습니다. 이유를 모르겠습니다.

최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!