<?php
         $page=ceil($_GET["page"]);
         $pl=ceil($_GET["pl"]);
         $isco=$_GET["isco"];
$mid=$_GET['mid'];
$lmid=$_GET['lmid']; //联盟ID
$classid1=ceil($_GET['classid1']);
$classid2=ceil($_GET['classid2']);
$keyword=cstr($_GET['keyword'],255);
$searchtype=cstr($_GET['searchtype'],20);
   if($action=='del'){
$id=ceil($_GET['id']);
if(!$id){
msg('提交ID参数错误!');
}
$db->query("delete from www_article where id=$id limit 1");
}
if($action=='search'){
$keyword=cstr($_POST['keyword'],255);
$searchtype=cstr($_POST['searchtype'],50);
echo "<meta http-equiv=refresh content='0; url=?showbody=list&pl=$pl&mid=$mid&classid1=$classid1&classid2=$classid2&keyword=$keyword&searchtype=$searchtype&isco=$isco&lmid=$lmid&'>"; 
die();
}
if($action=='delselect'){
$id=@implode(",",$_POST['id']);
if(!$id){
msg('提交ID参数错误!');
}
$db->query("delete from www_article where id in ($id)");
}
if($action=='set_pcmax'){
$pcmax=ceil($_POST['pcmax']);
if($pcmax>0){
$_SESSION['pcmax']=$pcmax;
}
}
if(!$_SESSION['pcmax']){$_SESSION['pcmax']=5;}
$pcmax=$_SESSION['pcmax'];
if($action=='set_topage'){
$topage=ceil($_POST['topage']);
if($topage>0){
echo "<meta http-equiv=refresh content='0; url=?showbody=list&pl=$pl&mid=$mid&classid1=$classid1&classid2=$classid2&keyword=$keyword&searchtype=$searchtype&page=$topage&isco=$isco&lmid=$lmid'>"; 
die();
}
}
?>
<script type="text/javascript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
  <table width="100%" border="0" align="center" cellPadding="3" cellSpacing="1" id="table2">
<tr>
<th width="100%" height="25" align="left" class="td_title">
<b>文章列表</b> <a href="article.php?showbody=add">添加文章</a> <a href="?showbody=list">[刷新]</a></th>
</tr>
<tr>
<td  class="td_content"><table width="100%" border="0" cellpadding="0" cellspacing="5">
                      <tr>
                        <td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="63%">
                        <select name="menu1" onChange="MM_jumpMenu('self',this,0)">
<?php $menu_url="?showbody=list&mid=$mid&classid1=$classid1&classid2=$classid2&page=$page&keyword=$keyword&searchtype=$searchtype&isco=$isco&lmid=$lmid&";?>
                          <option value="<?php echo $menu_url."pl=1"?>"<?php if($pl==1){echo " selected";}?>>按添加时间(升序)</option>
                          <option value="<?php echo $menu_url."pl=2"?>"<?php if($pl==2){echo " selected";}?>>按添加时间(降序)</option>
                          <option value="<?php echo $menu_url."pl=3"?>"<?php if($pl==3){echo " selected";}?>>按更新时间(升序)</option>
                          <option value="<?php echo $menu_url."pl=4"?>"<?php if($pl==4){echo " selected";}?>>按更新时间(降序)</option>
                          <option value="<?php echo $menu_url."pl=5"?>"<?php if($pl==5){echo " selected";}?>>按点击次数(升序)</option>
                          <option value="<?php echo $menu_url."pl=6"?>"<?php if($pl==6){echo " selected";}?>>按点击次数(降序)</option>
                          <option value="<?php echo $menu_url."pl=0"?>"<?php if($pl==0){echo " selected";}?>>默认排序</option>
                              </select>                            
  <select name="menu3" onchange="MM_jumpMenu('self',this,0)">
                                <?php
/****** 全部分类代码,为了速度快,先注释掉 by 老漂
                        $menu_url="?showbody=list&pl=$pl&mid=$mid&page=$page&keyword=$keyword&searchtype=$searchtype&isco=$isco&lmid=$lmid&";
?>
                                <option value="<?php echo $menu_url."classid="?>"<?php if($classid==''){echo " selected";}?>>全部分类</option>
                                <?php
$res1=$db->query("select * from www_class where upid=0 order by sx asc");
while($c1=$db->fetch_array($res1)){
$res2=$db->query("select * from www_class where upid=".$c1['cid']." order by sx asc");
while($c2=$db->fetch_array($res2)){
if($c2['cid']==$classid2){$selected=' selected';}else{$selected='';}
echo '<option value="'.$menu_url.'classid1='.$c1['cid'].'&classid2='.$c2['cid'].'"'.$selected.'>'.$c1['classname'].'-->'.$c2['classname'].'</option>';
}
}******/
?>

                              </select>
                              <select name="menu4" onchange="MM_jumpMenu('self',this,0)">
                                <?php $menu_url="?showbody=list&pl=$pl&classid1=$classid1&classid2=$classid2&page=$page&keyword=$keyword&searchtype=$searchtype&lmid=$lmid&";?>
                                <option value="<?php echo $menu_url."isco="?>"<?php if($isco==''){echo " selected";}?>>全部状态</option>
                                <option value="<?php echo $menu_url."isco=1"?>"<?php if($isco=='1'){echo " selected";}?>>已采</option>
                                <option value="<?php echo $menu_url."isco=0"?>"<?php if($isco=='0'){echo " selected";}?>>未采</option>
                                <option value="<?php echo $menu_url."isco=99"?>"<?php if($isco=='99'){echo " selected";}?>>标题为空</option>
                            </select>
                              <select name="menu2" onchange="MM_jumpMenu('self',this,0)">
                                <?php $menu_url="?showbody=list&pl=$pl&classid1=$classid1&classid2=$classid2&page=$page&keyword=$keyword&searchtype=$searchtype&";?>
                             <option value="<?php echo $menu_url."lmid="?>"<?php if($lmid==""){echo " selected";}?>>全部作者</option>
                                <? for($i=0;$i<count($lianmeng["name"]);$i++){?>
                            <option value="<?php echo $menu_url."lmid=".$i;?>"<?php if($lmid!="" && $lmid==$i){echo " selected";}?>><?php echo $lianmeng["name"][$i];?></option>
                                <?php
                                }
?>
                              </select></td>

解决方案 »

  1.   

     <?php $menu_url="?showbody=list&pl=$pl&mid=$mid&classid1=$classid1&classid2=$classid2&isco=$isco&lmid=$lmid&";?>
                                <form action="<?php echo $menu_url?>action=search" method="post" name="searchform" id="searchform">
                                  <td width="37%">搜索:
                                    <input name="keyword" type="text" id="keyword" size="12" value="<?php echo $keyword; ?>" maxlength="255" />
                                    <select name="searchtype" id="searchtype">
                                      <option value="title"<?php if($searchtype=='title'){echo ' selected';}?>>标题</option>                                  
                                      <option value="content"<?php if($searchtype=='content'){echo ' selected';}?>>内容</option>
                                      <option value="id"<?php if($searchtype=='id'){echo ' selected';}?>>ID</option>
                                      <option value="url"<?php if($searchtype=='url'){echo ' selected';}?>>目标网址</option>                              
                                    </select>
                                  <input type="submit" name="Submit22" value="搜索" /></td>
                                </form>
                              </tr>
                            </table></td>
                          </tr>
                        </table>
    <table width="100%" border="0" cellpadding="0" cellspacing="2">
                        <form method="POST" name="form" onSubmit="return check()">
                          <tr>
      <td width="515" align="center" bgcolor="#ffffff">标题</td>
                            <td width="37" height="25" align="center" bgcolor="#ffffff"><input type="checkbox" name="checkall" onclick="CheckAll(this.form)" /></td>
                            <td width="57" align="center" bgcolor="#ffffff">ID</td>
                            
                            <td width="169" align="center" bgcolor="#ffffff">分类</td>
                            <td width="137" align="center" bgcolor="#ffffff">添加</td>
                            <td width="135" align="center" bgcolor="#ffffff">更新</td>
                            <td width="160" align="center" bgcolor="#ffffff">tag</td>
                            <td align="center" bgcolor="#ffffff">操 作 </td>
                          </tr>
    <?php
    $sql1="select * from www_article where 1=1";
    //echo $sql1;
    if(strlen($mid)>=1){
    $mid=ceil($mid);
    $sql1.=" and mid=$mid";
    }
    if(strlen($isco)>=1){
    $isco=ceil($isco);
    if($isco==1){
    $sql1.=" and uptime>0";
    }elseif($isco==0){
    $sql1.=" and uptime=0";
    }elseif($isco==99){
    $sql1.=" and length(title)<2";
    }
    }
    if($classid2>0){
    $sql.=" and cid2=$classid2";
    }
    if($keyword and $searchtype){
    $sql1.=" and $searchtype like '%$keyword%'";
    }
    if($lmid){
    $lmid=ceil($lmid);
    $sql1.=" and lm=$lmid";
    }
    if($pl){
    if($pl==1){$sql.=" order by id asc";}
    if($pl==2){$sql.=" order by id desc";}
    if($pl==3){$sql.=" and uptime>0 order by uptime asc";}
    if($pl==4){$sql.=" and uptime>0 order by uptime desc";}
    if($pl==5){$sql.=" order by hits asc";}
    if($pl==6){$sql.=" order by hits desc";}
    }else{
    $sql.=" order by id desc";
    }
    //$sql1=$sql1.$sql;
    //$sql2=$sql2.$sql;
    if(!$_GET['page']){$page=1;}else{$page=ceil($_GET['page']);}
      $pagesize=$pcmax;  
      $i=1;
      $sql=$sql1.$sql." limit ".($page-1)*$pagesize.",". $pagesize;   
      $res=$db->query($sql);
      $res_num=$db->query($sql1);  
      $num=$db->num_rows($res_num);
         
      $pagecount=ceil($num/$pagesize);
         
      while($rs=$db->fetch_array($res)){
      if($i%2==0){$style="tdbg1";}else{$style="tdbg2";}
    ?>
                         <tr class="<?php echo $style; ?>" onMouseOut="this.className='<?php echo $style; ?>'" onMouseOver="this.className='over'">
                             <td align="left">
    <?php
    if ($rs['articletag']==null) {echo '<form method="get" action="tag.php">
    </br>标题:<input name="tag" type="text" value="'.$rs['title'].'">
    </br>数量:<input name="count" type="text" value="5">
    <input type="submit" name="q" value="开始查询">
    </form>';}?>
    </td>                        
                            <td height="25" align="center"><input type="checkbox" name="id[]" value="<?php echo $rs['id']; ?>"></td>
                           <td align="center"><a href="?showbody=add&id=<?php echo $rs['id'];?>" title="查看/编辑"><?php echo $rs['id']; ?></a></td>                        <td align="left"><?php /****注释掉分类 by老漂
       $rs2=$db->fetch_first("select classname from www_class where cid=".$rs['cid1']." limit 1");
       echo $rs2['classname'].'-';
        $rs3=$db->fetch_first("select classname from www_class where cid=".$rs['cid2']." limit 1");
       echo $rs3['classname']; ****/
      ?></td>
                            <td align="left"><?php //echo date('Y-m-d',$rs['addtime']);?></td>
                            <td align="left"><?php 
    if($rs['uptime']>0){
    echo date('Y-m-d',$rs['uptime']);
    }else{
    echo '从未';
    }
    ?></td>
                           <td align="center"></td>
                           <td width="81" align="center"><p>&nbsp;<a href="?showbody=list&action=del&id=<?php echo $rs['id'];?>" onClick="{if(confirm('确定要删除该文章?')){return true;}return false;}" >删除</a></p>                       </td>
                          </tr>
    <?php
    $i++;
    }
    ?>
       <tr>
                           <td height="25" colspan="9" align="center"><?php echo listpage("?showbody=list&pl=$pl&mid=$mid&classid1=$classid1&classid2=$classid2&page=$page&keyword=$keyword&searchtype=$searchtype&isco=$isco&lmid=$lmid&")?></td>
                           </tr>
       <tr>
         <td height="25" colspan="9" align="left"><input name=page type=hidden value=<?php echo $thispage;?>>
             <input name="del" type="submit" value="删除所选" onclick="goto(this.name)" style="width:120" id="del"> &nbsp;</td>
          </tr>
                    </form>
       <tr>
         <td height="25" colspan="9" align="center"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                               <tr>
                             <?php
                            $menu_url="?showbody=list&pl=$pl&mid=$mid&classid1=$classid1&classid2=$classid2&page=$page&keyword=$keyword&searchtype=$searchtype&isco=$isco&lmid=$lmid&";
    ?>
                                <form name="setpcmax" method="POST"  action="<?php echo $menu_url?>action=set_pcmax" >
                                 <td align="center">&nbsp;每页显示
                                   <input name="pcmax" type="text" id="pcmax" value="<?php echo $pcmax; ?>" size="4" maxlength="4" />
                                   <input type="submit" name="button" id="button" value="设定" /></td></form>
                                 <form name="setpcmax" method="POST" action="<?php echo $menu_url?>action=set_topage" >
                                 <td align="center">&nbsp;&nbsp;转到第
                                   <input name="topage" type="text" id="topage" value="<?php echo $thispage; ?>" size="4" maxlength="10" />页
    <input type="submit" name="button2" id="button2" value="跳转" /></td></form>
                               </tr>
                             </table></td>
          </tr>
                      </table></td>
    </tr>
      </table>
      

  2.   

    看看系统进程具体是什么进程占用了那么多CPU MYSQL 还是 apache...
      

  3.   

    apache.exe 15%
    mysqld-nt.exe 45%
      

  4.   

    看不出来具体可能出现的位置。建议你这样一小段一小段的加 exit();进行调试,找出最后问题的位置 再处理就可以了。