php简单验证码实例

<?php/** Created on 2011-7-31** To change the template for this generated file go to* Window - Preferences - PHPeclipse - PHP - Code Templates*/for($i=0;$i<4;$i++){ $rand.=rand(1,9);}$b=imagecreate(130,40);//建个图像imagecolorallocate($b,0,0,0);//设置图像颜色$color=imagecolorallocate($b,255,255,255);...
默认分类 | 2011-07-31 18:26 | 阅读 885 次 | 评论 0 条

php产生随机函数

<?php/*随即函数应用生成随机数—》创建图片-》随机数写进图片-》保持session中*/for($i=0;$i<4;$i++){$rand.=dechex(rand(1,15));//产生随机数}//新建个图像$image=imagecreatetruecolor(100,30);//设置颜色$bg=imagecolorallocate($image,0,0,0);//设置字体颜色$textcolor=imagecolorallocate($image,255,255,255);//把字符串写在图像上角imagestring($image,5,0,0,$rand,$textco...
php | 2011-07-30 15:08 | 阅读 911 次 | 评论 0 条

学习做php留言板系统

1 新建一个连接数据库文件:conn.php<?php/*数据库连接程序*/$conn = @ mysql_connect("localhost", "root", "") or die("数据库链接错误");mysql_select_db("newdb", $conn);mysql_query("set names 'GBK'"); //使用GBK中文编码;?>2 新建一个用户留言页面<?php/*用户注册留言页面*/include("conn.php");if($_POST['submit']){$sql="insert into message(id,user,title,co...
默认分类 | 2011-07-02 14:26 | 阅读 1434 次 | 评论 0 条