为什么无法输出一张图片
session_start();<br /> <br /> //随机码的个数<br /> //$_rnd_code = 4;<br /> <br /> //创建随机码<br /> for($i=0;$i<4;$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 /> <br /> //输出图像<br /> header('Content-Type:image/png');<br /> imagepng($_img);
<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 /> <br /><br /> <b>Warning</b>: Division by zero in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br /><br /> <br /><br /> <b>Notice</b>: Undefined variable: _heght in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br /><br /> <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 /> <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 /> <br /><br /> <b>Warning</b>: Division by zero in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br /><br /> <br /><br /> <b>Notice</b>: Undefined variable: _heght in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br /><br /> <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 /> <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 /> <br /><br /> <b>Warning</b>: Division by zero in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br /><br /> <br /><br /> <b>Notice</b>: Undefined variable: _heght in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br /><br /> <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 /> <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 /> <br /><br /> <b>Warning</b>: Division by zero in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br /><br /> <br /><br /> <b>Notice</b>: Undefined variable: _heght in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br /><br /> <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 /> <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 /> <br /><br /> <b>Warning</b>: Division by zero in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br /><br /> <br /><br /> <b>Notice</b>: Undefined variable: _heght in <b>D:\AMP\web\ide_tmp.php</b> on line <b>53</b><br /><br /> <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 /> ‰PNG<br />