2012年11月2日

php写简单的随机验证码

摘要: 跟着教程写随机的数字验证码?<?phpsession_start();//创建随机码$_nmsg = '';for($i = 0; $i<4; $i++){ $_nmsg .= dechex(mt_rand(0,15)); }//保存在session$_SESSION['code'] = $_nmsg;//创建一个真彩色图像$_width =75;$_height = 25;$_img = imagecreatetruecolor($_width, $_height);//白色$_white = imagecolorallocate($_img, 2 阅读全文

posted @ 2012-11-02 21:41 靖儿 阅读(855) 评论(1) 推荐(1) 编辑

导航