function generateTexte() { $chars="abcdefghjkmpqrstuvwxy"; $value=''; $len = strlen($chars); for($i=1; $i <= 5; $i++) { $n = mt_rand(0,$len-1); $value .= $chars[$n]; } return $value; } function randomColor($image) { $r = imagecolorallocate($image,100,100,100); return $r; } function makeitblack($image) { $r = imagecolorallocate($image,rand(0,75),rand(0,75),rand(0,75)); return $r; } // generation du texte $texte=generateTexte(); $SessionName=$Params['SessionName']; if($SessionName=='')$SessionName='inovagoracaptchaoperator_phrase'; $_SESSION[$SessionName] = $texte; header("Content-type: image/png"); header("Cache-Control: no-cache, must-revalidate"); $img = imagecreatetruecolor(150,60); $blank = imagecolorallocate($img ,255,255,255); $black = imagecolorallocate($img ,0,0,0); imagefill($img,0,0,$blank); $s = round(150/5); $x = 10; // Points $rdot = rand(75,100); for($d=0; $d <= $rdot; $d++) { imagesetpixel($img,rand(0,150),rand(0,60),randomColor($img)); } // Lignes $rline = rand(8,12); for($l=0; $l <= $rline; $l++) { imageline($img,rand(0,150),rand(0,60),rand(0,150),rand(0,60),randomColor($img)); } // Génération des lettres $font = 'design/standard/fonts/arial.ttf'; $anglemax=25; for($i=0; $i<=strlen($texte)-1; $i++){ $a = (rand(1,2)==1)?rand(0,$anglemax):rand(360-$anglemax,360); imagettftext($img,16,$a,$x,(60/2)+8,makeitblack($img),$font,$texte[$i]); $x+=$s; } imagepng($img); eZExecution::cleanExit(); ?>
Archives - Pas-de-Calais le Département
Les informations contenues dans cette page ne sont valables avec certitude que jusqu'Ă cette date et heure.