日期:2014-05-16 浏览次数:20479 次
session_start();
//随机码的个数
//$_rnd_code = 4;
//创建随机码
for($i=0;$i<4;$i++){
$_nmsg.=dechex(mt_rand(0,15));
}
//保存session
$_SESSION['code']=$_nmsg;
//长和高
$_width = 75;
$_height = 25;
//创建一张图像
$_img = imagecreatetruecolor($_width,$_height);
//输出图像
header('Content-Type:image/png');
imagepng($_img);
<br />
<b>Notice</b>: Undefined variable: _rnd_code in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br />
<br />
<b>Warning</b>: Division by zero in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br />
<br />
<b>Notice</b>: Undefined variable: _heght in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br />
<br />
<b>Warning</b>: mt_rand(): max(0) is smaller than min(1) in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br />
<br />
<b>Notice</b>: Undefined variable: _rnd_code in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br />
<br />
<b>Warning</b>: Division by zero in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br />
<br />
<b>Notice</b>: Undefined variable: _heght in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br />
<br />
<b>Warning</b>: mt_rand(): max(0) is smaller than min(1) in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br />
<br />
<b>Notice</b>: Undefined variable: _rnd_code in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br />
<br />
<b>Warning</b>: Division by zero in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br />
<br />
<b>Notice</b>: Undefined variable: _heght in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br />
<br />
<b>Warning</b>: mt_rand(): max(0) is smaller than min(1) in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br />
<br />
<b>Notice</b>: Undefined variable: _rnd_code in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br />
<br />
<b>Warning</b>: Division by zero in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br />
<br />
<b>Notice</b>: Undefined variable: _heght&