84669 人が学習中
152542 人が学習中
20005 人が学習中
5487 人が学習中
7821 人が学習中
359900 人が学習中
3350 人が学習中
180660 人が学習中
48569 人が学習中
18603 人が学習中
40936 人が学習中
1549 人が学習中
1183 人が学習中
32909 人が学習中
发现部分空间是可以部分空间不可以,报下面的错误{ResponseInfo:com.qiniu.http.Response@74d25d10,status:631, reqId:OUgAAEnJhJQ3MY4U, xlog:CFGG:3/612;ZONEPROXY:12/631, xvia:, adress:rsf.qbox.me/183.136.139.24:80, duration:0.000000 s, error:no such bucket}
学习是最好的投资!
<?php
/**
* 認証コードカテゴリ
*/
$code= new Code();
$code->outImage();
class Code
{
protected $number;
protected $codeType;
protected $width;
protected $height;
protected $image;
protected $code;
public function __construct($number=4,$codeType=2,$width= 100,$height=30)
$this->number=$number;
$this->codeType=$codeType;
$this->width=$width;
$this ->height=$height;
$this->code=$this->createCode();
}
public function __get($name){
if ($name=='code' ) {
return $this->code;
}else{
return false;
public function __destruct(){
imagedestroy($this->image);
保護関数 createCode(){
switch ($this->codeType) {
case '0':
$code=$this->getNumberCode();
Break;
case ' 1':
$code=$this->getCharCode();
ブレーク;
ケース '2':
$code=$this->getNumberCharCode();
デフォルト:
die("对不起,不支持该验证码类型!!!!");
return $code;
protected function getNumberCode(){
$str=join('',range (0, 9));
return substr(str_shuffle($str), 0,$this->number);
protected function getCharCode(){
$str=join('',range (a, z));
$str=$str.strtoupper($str);
protected function getNumberCharCode (){
$str1=join('',range(0, 9));
$str=join('',range(a, z));
$str=$str1.$str. strtoupper($str);
public function outImage(){
$this->createImage();
$this->fillBack();
$this->drawChar();
$this->drawDistrub();
$this->show();
保護された関数createImage(){
$this->image=imagecreatetruecolor($this->幅, $this->高さ);
保護関数 fillBack(){
imagefill($this-> image, 0, 0, $this->lightColor());
保護関数 lightColor(){
return imagecolorallocate($this->image, mt_rand(130,255), mt_rand(130,255), mt_rand (130,255));
protected function darkColor(){
return imagecolorallocate($this->image, mt_rand(0,120), mt_rand(0,120), mt_rand(0,120));
protected functiondrawChar(){
for ($i=0; $i 番号; $i++) {
$Width=$this->幅/$this->数値;
$x=mt_rand($i*$Width+10,($i+1)*$Width-15);
$y=mt_rand(0,$this->height-18);
imagechar( $this->image, 6, $x, $y, $this->code[$i], $this->darkColor());
保護関数drawDistrub(){
for ($i=0; $i
$x=mt_rand(0,$this->width);
$y=mt_rand(0,$this-> height);
imagesetpixel($this->image, $x, $y, $this->lightColor());
protected function show(){
header("Content -Type:image/png");
imagepng($this->image);
?>
<?php
/**
* 認証コードカテゴリ
*/
$code= new Code();
$code->outImage();
class Code
{
protected $number;
protected $codeType;
protected $width;
protected $height;
protected $image;
protected $code;
public function __construct($number=4,$codeType=2,$width= 100,$height=30)
{
$this->number=$number;
$this->codeType=$codeType;
$this->width=$width;
$this ->height=$height;
$this->code=$this->createCode();
}
public function __get($name){
if ($name=='code' ) {
return $this->code;
}else{
return false;
}
}
public function __destruct(){
imagedestroy($this->image);
}
保護関数 createCode(){
switch ($this->codeType) {
case '0':
$code=$this->getNumberCode();
Break;
case ' 1':
$code=$this->getCharCode();
ブレーク;
ケース '2':
$code=$this->getNumberCharCode();
ブレーク;
デフォルト:
die("对不起,不支持该验证码类型!!!!");
}
return $code;
}
protected function getNumberCode(){
$str=join('',range (0, 9));
return substr(str_shuffle($str), 0,$this->number);
}
protected function getCharCode(){
$str=join('',range (a, z));
$str=$str.strtoupper($str);
return substr(str_shuffle($str), 0,$this->number);
}
protected function getNumberCharCode (){
$str1=join('',range(0, 9));
$str=join('',range(a, z));
$str=$str1.$str. strtoupper($str);
return substr(str_shuffle($str), 0,$this->number);
}
public function outImage(){
$this->createImage();
$this->fillBack();
$this->drawChar();
$this->drawDistrub();
$this->show();
}
保護された関数createImage(){
$this->image=imagecreatetruecolor($this->幅, $this->高さ);
}
保護関数 fillBack(){
imagefill($this-> image, 0, 0, $this->lightColor());
}
保護関数 lightColor(){
return imagecolorallocate($this->image, mt_rand(130,255), mt_rand(130,255), mt_rand (130,255));
}
protected function darkColor(){
return imagecolorallocate($this->image, mt_rand(0,120), mt_rand(0,120), mt_rand(0,120));
}
protected functiondrawChar(){
for ($i=0; $i 番号; $i++) {
$Width=$this->幅/$this->数値;
$x=mt_rand($i*$Width+10,($i+1)*$Width-15);
$y=mt_rand(0,$this->height-18);
imagechar( $this->image, 6, $x, $y, $this->code[$i], $this->darkColor());
}
}
保護関数drawDistrub(){
for ($i=0; $i
$x=mt_rand(0,$this->width);
$y=mt_rand(0,$this-> height);
imagesetpixel($this->image, $x, $y, $this->lightColor());
}
}
protected function show(){
header("Content -Type:image/png");
imagepng($this->image);
}
}
?>