首页上一页 1 下一页尾页 1 条记录 1/1页
php项目开发全程实录第一章中的付费信息显示find_fufei.php
发表在PHP图书答疑
2009-12-29
是否精华
是
否
版块置顶:
是
否
$state=$_POST[state];
$type=$_POST[type];
if($_POST[type]==""){
$state=$_GET[state]; //在表单中使用post发送,这里为什么使用get接收?
$type=$_GET[type];
}
if($state=="all"){
$sql1=mysql_query("select count(*) as total from tb_info where type='$type' order by edate");
}else{
$sql1=mysql_query("select count(*) as total from tb_info where type='$type' and checkstate=$state order by edate");
}
$minfo=mysql_fetch_array($sql1);
$total=$minfo[total]; //这里的total变量代表什么?从何来?
$pagesize=10;
if($total<=$pagesize){
$pagecount=1;
}
if(($total%$pagesize)!=0){
$pagecount=intval($total/$pagesize)+1;
}else{
$pagecount=$total/$pagesize;
}
if(($_GET[page])==""){//这里的page变量从何来?
$page=1;
}else{
$page=intval($_GET[page]);
}
if($state=="all"){
$sql=mysql_query("select * from tb_info where type='$type' order by edate limit ".($page-1)*$pagesize.",$pagesize");
}else{
$sql=mysql_query("select * from tb_info where type='$type' and checkstate=$state order by edate limit ".($page-1)*$pagesize.",$pagesize");//这句查询语句是什么意思?
}
$info=mysql_fetch_array($sql);
?>
<table width="776" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="32" background="images/right_line.gif"> 您现在的位置:九九度供求信息网 > 后台管理系统</td>
</tr>
<tr>
<td height="32" background="images/right_top.gif"> </td>
</tr>
<tr>
<td height="488" align="center" valign="top" background="images/right_middle.gif">
当前信息类别: 『<span class="style11"> <?php echo $type;?> </span>』<br>
<table width="708" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFCC33">
<tr align="center" bgcolor="#FFCC33">
<td width="111">信息标题</td>
<td width="203">信息内容</td>
<td width="63">联系人</td>
<td width="79">联系电话</td>
<td width="125">发布时间</td>
<td width="61">审核状态</td>
<td width="58">操作</td>
</tr>
<?php
if($info){
do{
if($info[checkstate]==1){
$state1="已审核";
}else{
$state1="未审核";
}
?>
<tr bgcolor="#FFFFFF">
<td> <?php echo $info[title];?></td>
<td> <?php echo $info[content];?></td>
<td> <?php echo $info[linkman];?></td>
<td> <?php echo $info[tel];?></td>
<td> <?php echo $info[edate];?></td>
<td align="center" class="style11"><?php echo $state1;?></td>
<td align="center" bgcolor="#FFFFFF">
<a href="state_ok.php?id=<?php echo $info[id];?>&type=<?php echo $type;?>&state=<?php echo $state;?>">审核</a>/
<a href="miandel_ok.php?id=<?php echo $info[id];?>&type=<?php echo $type;?>&state=<?php echo $state;?>">删除</a>
//miandel_ok.php?id=<?php echo $info[id];?>&type=<?php echo $type;?>&state=<?php echo $state;?>是什么意思?
//miandel_ok.php?id=<?php echo $info[id];?>是什么意思?
</td>
</tr>
<?php
}while($info=mysql_fetch_array($sql));
?>
<tr bgcolor="#FFFFDD">
<td height="22" colspan="7" align="right"> 共有
<?php
echo $total;
?>
条 每页显示 <?php echo $pagesize;?> 条 第 <?php echo $page;?> 页/共 <?php echo $pagecount; ?> 页
<?php
if($page>=2){
?>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=1" title="首页"></a>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=<?php echo $page-1;?>" title="上一页"></a>
<?php
}
if($pagecount<=4){
for($i=1;$i<=$pagecount;$i++){
?>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=<?php echo $i;?>"><?php echo $i;?></a>
<?php
}
}else{
for($i=1;$i<=4;$i++){
?>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=<?php echo $i;?>"><?php echo $i;?></a>
<?php }?>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=<?php echo $page-1;?>" title="下一页"></a>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=<?php echo $pagecount;?>" title="尾页"></a>
//首页、下一页、上一页和尾页这段语句您能帮我解释一下?
$type=$_POST[type];
if($_POST[type]==""){
$state=$_GET[state]; //在表单中使用post发送,这里为什么使用get接收?
$type=$_GET[type];
}
if($state=="all"){
$sql1=mysql_query("select count(*) as total from tb_info where type='$type' order by edate");
}else{
$sql1=mysql_query("select count(*) as total from tb_info where type='$type' and checkstate=$state order by edate");
}
$minfo=mysql_fetch_array($sql1);
$total=$minfo[total]; //这里的total变量代表什么?从何来?
$pagesize=10;
if($total<=$pagesize){
$pagecount=1;
}
if(($total%$pagesize)!=0){
$pagecount=intval($total/$pagesize)+1;
}else{
$pagecount=$total/$pagesize;
}
if(($_GET[page])==""){//这里的page变量从何来?
$page=1;
}else{
$page=intval($_GET[page]);
}
if($state=="all"){
$sql=mysql_query("select * from tb_info where type='$type' order by edate limit ".($page-1)*$pagesize.",$pagesize");
}else{
$sql=mysql_query("select * from tb_info where type='$type' and checkstate=$state order by edate limit ".($page-1)*$pagesize.",$pagesize");//这句查询语句是什么意思?
}
$info=mysql_fetch_array($sql);
?>
<table width="776" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="32" background="images/right_line.gif"> 您现在的位置:九九度供求信息网 > 后台管理系统</td>
</tr>
<tr>
<td height="32" background="images/right_top.gif"> </td>
</tr>
<tr>
<td height="488" align="center" valign="top" background="images/right_middle.gif">
当前信息类别: 『<span class="style11"> <?php echo $type;?> </span>』<br>
<table width="708" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFCC33">
<tr align="center" bgcolor="#FFCC33">
<td width="111">信息标题</td>
<td width="203">信息内容</td>
<td width="63">联系人</td>
<td width="79">联系电话</td>
<td width="125">发布时间</td>
<td width="61">审核状态</td>
<td width="58">操作</td>
</tr>
<?php
if($info){
do{
if($info[checkstate]==1){
$state1="已审核";
}else{
$state1="未审核";
}
?>
<tr bgcolor="#FFFFFF">
<td> <?php echo $info[title];?></td>
<td> <?php echo $info[content];?></td>
<td> <?php echo $info[linkman];?></td>
<td> <?php echo $info[tel];?></td>
<td> <?php echo $info[edate];?></td>
<td align="center" class="style11"><?php echo $state1;?></td>
<td align="center" bgcolor="#FFFFFF">
<a href="state_ok.php?id=<?php echo $info[id];?>&type=<?php echo $type;?>&state=<?php echo $state;?>">审核</a>/
<a href="miandel_ok.php?id=<?php echo $info[id];?>&type=<?php echo $type;?>&state=<?php echo $state;?>">删除</a>
//miandel_ok.php?id=<?php echo $info[id];?>&type=<?php echo $type;?>&state=<?php echo $state;?>是什么意思?
//miandel_ok.php?id=<?php echo $info[id];?>是什么意思?
</td>
</tr>
<?php
}while($info=mysql_fetch_array($sql));
?>
<tr bgcolor="#FFFFDD">
<td height="22" colspan="7" align="right"> 共有
<?php
echo $total;
?>
条 每页显示 <?php echo $pagesize;?> 条 第 <?php echo $page;?> 页/共 <?php echo $pagecount; ?> 页
<?php
if($page>=2){
?>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=1" title="首页"></a>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=<?php echo $page-1;?>" title="上一页"></a>
<?php
}
if($pagecount<=4){
for($i=1;$i<=$pagecount;$i++){
?>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=<?php echo $i;?>"><?php echo $i;?></a>
<?php
}
}else{
for($i=1;$i<=4;$i++){
?>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=<?php echo $i;?>"><?php echo $i;?></a>
<?php }?>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=<?php echo $page-1;?>" title="下一页"></a>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=<?php echo $pagecount;?>" title="尾页"></a>
//首页、下一页、上一页和尾页这段语句您能帮我解释一下?