上一页 1 ··· 8 9 10 11 12 13 下一页
摘要: 文件名:login.php<?phpinclude("conn.php"); if($_GET[out]){ setcookie("cookie", "out"); echo "<script language=\"javascript\">location.href='login.php';</script>"; } if($_POST[id]=='admin'){ $pw=md5($_POST[pw]); if($pw==' 阅读全文
posted @ 2012-06-30 17:21 神马和浮云 阅读(944) 评论(0) 推荐(0) 编辑
摘要: 文件名:list.php说明:mysql_fetch_array()mysql_fetch_array(data,array_type)函数从结果集中取得一行作为关联数组,或数字数组,或二者兼有返回根据从结果集取得的行生成的数组,如果没有更多行则返回 false。data 可选。规定规定要使用的数据指针。该数据指针是 mysql_query() 函数产生的结果。array_type 可选。规定返回哪种结果。可能的值:MYSQL_ASSOC - 关联数组;MYSQL_NUM - 数字数组;MYSQL_BOTH - 默认。同时产生关联和数字数组<?php include("conn 阅读全文
posted @ 2012-06-30 17:19 神马和浮云 阅读(1071) 评论(0) 推荐(0) 编辑
摘要: 文件名:add.php<?php include("conn.php"); if($_POST['submit']){ $sql="insert into message (id,user,title,content,lastdate) " . "values ('','$_POST[user]','$_POST[title]','$_POST[content]',now())"; mysql_query($sql); echo "< 阅读全文
posted @ 2012-06-30 17:10 神马和浮云 阅读(2237) 评论(0) 推荐(0) 编辑
摘要: 设置php的编码,可在php文件标识符的下面添加@header('Content-type: text/html; charset=UTF-8'); 阅读全文
posted @ 2012-06-30 10:47 神马和浮云 阅读(1597) 评论(0) 推荐(0) 编辑
摘要: PHP5的方法 文件名为:conn.php 查询数据库使用以下方法测试 阅读全文
posted @ 2012-06-30 10:38 神马和浮云 阅读(1884) 评论(1) 推荐(0) 编辑
摘要: 留言条数的id,类型为整形,并且为主键留言者的名字,也就是用户名,类型为字符型,长度10,可根据需求自行设置留言的标题,类型为字符型,长度50,可根据需求自行设置留言内容,类型为a56爆大奖在线娱乐留言时间,类型为时间型MYSQL代码:CREATE TABLE `message` (`id` int NOT NULL ,`user` char(10) NOT NULL ,`title` varchar(50) NOT NULL ,`content` text NOT NULL ,`lastdate` time NOT NULL ,PRIMARY KEY (`id`));数据库字段可根据需求自行配置 阅读全文
posted @ 2012-06-30 10:25 神马和浮云 阅读(1339) 评论(0) 推荐(0) 编辑
摘要: <?phpinclude_once 'common.php';include 'conn.php';$sql_add="insert into `message` (`id`,`user`,`title`,`content`,`lastdate`) values ('','$_POST[user]','$_POST[title]','$_POST[content]',now())";if ($_POST[submit]){ mysql_query($sql_add); if 阅读全文
posted @ 2012-06-29 17:48 神马和浮云 阅读(1262) 评论(1) 推荐(0) 编辑
摘要: 双选确认框,点击是跳转到yes.html,点击否跳转到no.html<?phpecho "<script> if(confirm( '请选择跳转页面,是跳转到yes.html 否跳转到no.html? ')) location.href='yes.html';else location.href='no.html'; </script>"; ?>双选确认框,选择后继续弹出确认对话框<?phpecho "<script> var sure=confirm( ' 阅读全文
posted @ 2012-06-29 17:45 神马和浮云 阅读(16960) 评论(0) 推荐(1) 编辑
摘要: 假设在127.0.0.1上有test1和test2两个库, 其中库test1库中有test1表,test2中有test2表$servername = "127.0.0.1";$username = "root";$password = "root";$conn1 = mysql_connect($servername, $username, $password);mysql_select_db('test1', $conn1);$conn2 = mysql_connect($servername, $username, 阅读全文
posted @ 2012-06-29 12:02 神马和浮云 阅读(2120) 评论(0) 推荐(0) 编辑
摘要: $val1=<?php$arr1['laruence'] = 'huixinchen';$arr1['yahoo'] = 2007;$arr1['baidu'] = 2008;foreach ($arr1 as $key => $val1) { echo $val1;//结果是什么?}?><br>$val2=<?php$arr2[2] = 'huixinchen';$arr2[1] = 2007;$arr2[0] = 2008;foreach ($arr2 as $key =&g 阅读全文
posted @ 2012-06-28 17:40 神马和浮云 阅读(6359) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 下一页