loveloop
注册会员

UID 78018
精华
0
积分 188
帖子 156
金钱 188 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2006-8-10 来自 北京市
状态 离线
|
快要让我崩溃的一个我问题。。求求高后们过来看看
下面这段代码在语法上没有错误(可以成功运行的),但是结果却是用数组给set_order.php传过去的几个值会发生"变异",搞不懂为什么?高手请指点,我实在找不出什么问题。。。
<html>
<head>
<title>泡泡小区</title>
<script language="javascript">
function CheckAll(form){
var r=form.elements[0];
r.checked == true ? r.checked = false : r.checked = true;
for (var i=0;i<form.elements.length;i+=7){
var e = form.elements;
e.checked == true ? e.checked = false : e.checked = true;}
}
</script>
</head>
<body>
<?php
require_once("global.php"); //该文件只包含一个函数substrs,作用是控制标题显示长度
$mylink=mysql_connect("localhost","root","myoa888");
mysql_select_db("popxqnew",$mylink);
$sql3="select `cat_id` from `popxq_info_issue` where `cat_id`=1";
$result3=mysql_query($sql3);
$total_num=mysql_num_rows($result3); //返回记录总数
$total_page=ceil($total_num/10); //返回总页数
if($page<=0)$page=1;
if($page>=$total_page) $page=$total_page;
$next_page=$page+1;$pre_page=$page-1;
$now_first=($page-1)*10;
$sql="select * from `popxq_info_issue` where `cat_id`=1 order by `info_order` desc limit $now_first,10";
$result=mysql_query($sql,$mylink);
if($result)
{ $num=1;
include("header.php");?>
<form action=set_order.php method=post>
<table class=table1>
<tr class="tr"><th width="3%">编号</th><th width="21%">标题</th><th width="8%">发布状态</th><th width="9%">排序</th><th width="9%">访问级别</th><th width="9%">一级类别</th><th width="9%">二级类别</th><th width="21%">创建日期</th><th width="4%">修改</th><th width="7%">归档<br><input type="checkbox" name="chkAll" onclick="CheckAll(this.form)"></th></tr>
<? while($myarray=mysql_fetch_array($result))
{
$full_title=$myarray[info_name];
$myarray[info_name]=substrs($myarray[info_name],22);//控制标题的显示长度
echo"<tr><td class=td1 align=center>$num</td><td class=td1><a class=td href=edit.php?info_id=$myarray[info_id] title=标题 full_title 操作:修改这篇文章 点击次数 myarray[info_hits] 作者 myarray[created_by_alias]> $myarray[info_name]</a></td><td class=td1 align=center>";
if($myarray[topic_issue_status]==1) $topic_issue_status="已发布";
if($myarray[topic_issue_status]==0) $topic_issue_status="待发布";
if($myarray[topic_issue_status]==2) $topic_issue_status="未发布";
echo"$topic_issue_status</td><td class=td1 align=center valign=middle height=28><input name=up value=升 type=submit title=把这条信息提前一个位置><input name=down value=降 type=submit title=把这条信息降低一个位置><input type=submit value=顶 name=top title=把这条信息置顶><input type=hidden name=info_id value=$myarray[info_id] ><input type=hidden name=info_order value=$myarray[info_order] ><input type=hidden name=cat_id value=$myarray[cat_id]></td><td class=td1 align=center>";
if($myarray[info_access]==0) $info_access="所有人";
if($myarray[info_access]==1) $info_access="注册用户";
if($myarray[info_access]==2) $info_access="认证用户";
echo"$info_access</td><td class=td1 align=center>";
$sql1="select `cat_id`,`cat_title` from `popxq_categories` where cat_id=".$myarray[cat_id];
$result1=mysql_query($sql1,$mylink);
if($result1)$myarray1=mysql_fetch_array($result1);
echo"$myarray1[cat_title] </td><td class=td1 align=center>";
$sql2="select `forum_id`,`forum_name` from `popxq_forums` where forum_id=".$myarray[forum_id];
$result2=mysql_query($sql2,$mylink);
if($result2)$myarray2=mysql_fetch_array($result2);
echo"$myarray2[forum_name] </td><td class=td1 align=center>$myarray[info_datetime] </td><td class=td1 align=center><a class=td href=edit.php?info_id=$myarray[info_id] title=修改这篇文章>改</a></td><td class=td1 align=center><input type=checkbox value=$myarray[info_id] name=guidang[]></td></tr>";
$num++;
$i++;
}
?>
</table>
<? //分页代码
echo"<p align=center>共有";echo$total_num;echo"条信息,共";echo$total_page;echo"页,当前第";echo$page;echo"页 <a class='td'href=?page=1>首页</a> <a class='td' href=?page=$pre_page>上一页</a> <a class='td' href=?page=$next_page>下一页</a> <a class='td' href=?page=$total_page>尾页</a> <input type=submit value=归档 title='将选中的所有信息归档保存' name=keep>";
}
?>
</form>
</body>
</html>
|
|