erreur de session
富贵
富贵 2017-09-29 21:48:29
0
3
1536

<?php

session_start();

$str = '';

$width = 300;

$height = 100;

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

$ blanc = imagecolorallocate($img, 255, 255, 255);

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

imagefilledrectangle($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 = ($largeur/4)*$i+mt_rand(1,9);

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

$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, $largeur), mt_rand(0,$hauteur), setColor($img));

}

pour($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 );

? >


富贵
富贵

répondre à tous(3)
寻觅 beyond

Il devrait y avoir un problème à une certaine étape de votre dessin, et les quatre personnages aléatoires générés ont réussi

林

Envoyez au moins le contenu du rapport d'erreur ensemble, sinon comment saurai-je quelle erreur vous avez signalée ?

直奔十维

Je ne connais pas la raison, je ne connais pas la raison, je ne connais pas la raison, je ne connais pas la raison

Derniers téléchargements
Plus>
effets Web
Code source du site Web
Matériel du site Web
Modèle frontal
À propos de nous Clause de non-responsabilité Sitemap
Site Web PHP chinois:Formation PHP en ligne sur le bien-être public,Aidez les apprenants PHP à grandir rapidement!