看看小弟我在注册码不显示。显示为红叉。哪位高手帮忙解决下

WBOY
풀어 주다: 2016-06-13 12:41:48
원래의
800명이 탐색했습니다.

看看我在注册码不显示。显示为红叉。谁帮忙解决下?

<br />
<?php<br />
/**<br />
* TestGuest Version1.0<br />
* ================================================<br />
* Copy 2010-2012 yc60<br />
* Web: http://www.yc60.com<br />
* ================================================<br />
* Author: Lee<br />
* Date: 2010-8-13<br />
*/<br />
session_start();<br />
<br />
//随机码的个数<br />
$_rnd_code = 4;<br />
<br />
//创建随机码<br />
for ($i=0;$i<$_rnd_code;$i++) {<br />
	$_nmsg .= dechex(mt_rand(0,15));<br />
}<br />
<br />
//保存在session<br />
$_SESSION['code'] = $_nmsg;<br />
<br />
//长和高<br />
$_width = 75;<br />
$_height = 25;<br />
<br />
//创建一张图像<br />
$_img = imagecreatetruecolor($_width,$_height);<br />
<br />
//白色<br />
$_white = imagecolorallocate($_img,255,255,255);<br />
<br />
//填充<br />
imagefill($_img,0,0,$_white);<br />
<br />
$_flag = false;<br />
<br />
if ($_flag) {<br />
	//黑色,边框<br />
	$_black = imagecolorallocate($_img,0,0,0);<br />
	imagerectangle($_img,0,0,$_width-1,$_height-1,$_black);<br />
}<br />
<br />
//随即画出6个线条<br />
for ($i=0;$i<6;$i++) {<br />
	$_rnd_color = imagecolorallocate($_img,mt_rand(0,255),mt_rand(0,255),mt_rand(0,255));<br />
	imageline($_img,mt_rand(0,$_width),mt_rand(0,$_height),mt_rand(0,$_width),mt_rand(0,$_height),$_rnd_color);<br />
}<br />
<br />
//随即雪花<br />
for ($i=0;$i<100;$i++) {<br />
	$_rnd_color = imagecolorallocate($_img,mt_rand(200,255),mt_rand(200,255),mt_rand(200,255));<br />
	imagestring($_img,1,mt_rand(1,$_width),mt_rand(1,$_height),'*',$_rnd_color);<br />
}<br />
<br />
//输出验证码<br />
for ($i=0;$i<strlen($_SESSION['code']);$i++) {<br />
	$_rnd_color = imagecolorallocate($_img,mt_rand(0,100),mt_rand(0,150),mt_rand(0,200));<br />
	imagestring($_img,5,$i*$_width/$_rnd_code+mt_rand(1,10),mt_rand(1,$_height/2),$_SESSION['code'][$i],$_rnd_color);<br />
}<br />
<br />
//输出图像<br />
header('Content-Type: image/png');<br />
imagepng($_img);<br />
<br />
//销毁<br />
imagedestroy($_img);<br />
<br />
<br />
<br />
<br />
<br />
<br />
?><br />
<br />
로그인 후 복사


有高人吗?

Color
관련 라벨:
원천:php.cn
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.
인기 튜토리얼
더>
최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿
회사 소개 부인 성명 Sitemap
PHP 중국어 웹사이트:공공복지 온라인 PHP 교육,PHP 학습자의 빠른 성장을 도와주세요!