PHP头条
热点:

代码-php怎么将验证码返回给androin?


代码验证码phpandroid

php生成验证码及图片的代码如下:

header('Content-type:image/png');
require_once './function.php';
$width=65;
$height=20;
$image=imagecreate($width,$height);

$bg_color=imagecolorallocate($image,0x33,0x66,0xFF);
imagefilledrectangle($image,0,0,$width,$height,$bg_color);
$text=random(5);
$font=5;
$x=imagesx($image)/2-strlen($text)*imagefontwidth($font)/2;
$y=imagesy($image)/2-imagefontheight($font)/2;

$fg_color=imagecolorallocate($image,0xFF,0xFF,0xFF);
imagestring($image,$font,$x,$y,$text,$fg_color);

$_COOKIE['captcha']=$text;

imagepng($image);
imagedestroy($image);?>

怎么给android啊

www.phpzy.comtrue/phpyy/1508.htmlTechArticle代码-php怎么将验证码返回给androin? 代码验证码phpandroid php生成验证码及图片的代码如下: header('Content-type:image/png'); require_once './function.php'; $width=65; $height=20; $image=imagecreate($width,$heigh...

相关文章

相关频道:

PHP之友评论

今天推荐