国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > PHP > 正文

人大復印資料處理程序_查詢篇

2024-05-04 23:01:17
字體:
來源:轉載
供稿:網友
中國最大的web開發資源網站及技術社區,
<?
//本程序為一個搜索,目前設計服務于文章庫。
//編者:孔秀祥。日期:2001/4/10
if(!$uploadaction):
require "config.php3";
if(!isset($table)){
//$table="artical";
}
/*
$[email protected]_connect($hostname,$dbusername,$dbpassword) or die("不能連接數據庫!");
@mysql_select_db("$dbname") or die("不能選擇數據庫!");
$q="select count(id) from $table where 1 ";
$result = @mysql_query($q);
$row = @mysql_fetch_array($result);
  $r_count=$row["count(artical_id)"];
*/   
   
?>
<html><head><title>數據庫搜索 </title>
</head>
<body><table align=center cellpadding="0" cellspacing="0" width="420" >
<th colspan=2 bgcolor=726cc5>
<!--tr><td colspan=2 bgcolor=726cc5-->
<font color=white face=arial,helvetica size=2>
<center>
本程序運行較費時間,需要耐心等待。</th>

<form enctype= "multipart/form-data" name = "submitform"
action= "<? $php_self ?>" method = "post">
<!--input type= "hidden" name = "max_file_size" value ="2500000"-->
<input type= "hidden" name = "uploadaction" value = "1">
<input type= "hidden" name = "table" value = "<? echo $table; ?>" >
<input type="hidden" name=table value="artical">
<tr  border=1><td colspan=2 align=center>查詢項目
<tr><td colspan=2 align=center><input type="radio" name=a_data value="data" checked>文章內容
<input type="radio" name=a_data value="title">文章標題
<input type="radio" name=a_data value="author">文章作者
<input type="radio" name=a_data value="month" >期刊名
<!--input type="radio" name=a_data value="type" >分類號<br-->
<tr><td>搜索內容<td><input name = "data_search" type = "text" value="" size = "30"></td>
<tr><td>索引文件名<td><input name = "index_file" type = "text" value="" size = "30"></td>
<tr><td>索引標題<td><input name = "index_title" type = "text" value="" size = "30"></td>
<!--tr><td>從第<input name = "s_id" type = "text" value="1" size = "4"><td>
開始的<input name = "step" type = "text" value="100" size = "4">條,共有<? echo $r_count ?>條記錄。</td></tr-->
<tr><td>文章分類</td>
<td>
<select size="1" name="catalog" type = "int">
?<option selected value="11">語言理論</option>
<option value="21">歷史學</option>
<option value="31">中國哲學</option>
<option value="41">其他</option>
?<!--option selected value="11">語言理論</option-->
</select>
</tr>
<tr><td colspan=3 align=center>
<input name = "submit" value = "提交" type = "submit">
<input name = "reset" value = "重置" type = "reset"></td>
</td></tr>
</form></center></table></body>

</html>

<?

else:

require "config.php3";
$uploadaction=0;
$added=0;
$die=0;
$single_chinese=0;
$timelimit=0; /*設置超時限制時間缺省時間為 30秒設置為0時為不限時 */
set_time_limit($timelimit);

if($data_search==""){
//做全庫的索引
header("location:/progs/data_index.php3");
//$msg="搜索內容不能為空。";
//xueroom_error_exit($msg,$php_self);
}


$[email protected]_connect($hostname,$dbusername,$dbpassword) or die("不能連接數據庫!");
@mysql_select_db("$dbname") or die("不能選擇數據庫!");
//select id,file_name,artical_author from textfile where 1 limit 0, 30   
if($table=="artical")
{
$sid="artical_id";
$stitle="artical_title";
$sauthor="artical_author";
$sdata="artical_data";
$prog="readfile.php3";
if($a_data=="month" )
    $key_where="where origin_periodical rlike '^.*$data_search.*'";
}
if($a_data=="data" )
    $key_where="where $sdata rlike '^.*$data_search.*'";
if($a_data=="title" )
    $key_where="where $stitle rlike '^.*$data_search.*'";
if($a_data=="author" )
    $key_where="where $sauthor rlike '^.*$data_search.*'";

//$q="select $sid,$stitle,$sauthor from $table where $sdata rlike '^.*$data_search.*'order by $stitle";
if(($a_data=="data")&&(strlen($data_search)==2)){
    $q="select $sid,$stitle,$sauthor,$sdata from $table $key_where order by $stitle";
    $single_chinese=1;
    }
else{
    $q="select $sid,$stitle,$sauthor from $table $key_where order by $stitle";
}
$index_data="";
$count=0;
$result [email protected] mysql_query($q);

if(!$result){
    $msg="沒有符合要求的記錄。";
    xueroom_error_exit($msg,$php_self);
}
while($row = @mysql_fetch_array($result)) {
  if(($single_chinese)&&(!mystrpos($row[$sdata],$data_search)))
  continue;
  else
  {
    $id=$row[$sid];
      $title=$row[$stitle];
      $author=$row[$sauthor];
      if($table=="textfile")
        $title=preg_replace("/.txt/","",$title);
//  $data=$row["artical_data"];
  //if(mystrpos($data,$data_search)) //可以用于尋找單個漢字。
//  if(strpos($data,$data_search)){  //大于一個漢字時采用本判斷式,速度較快。
      $index_data.="<tr><td><a href=".$dataurl."$prog?$sid=$id>$title</a><td>作者:$author </tr>";
      $count++;
  //fputs($fp, "<tr><td><a href=".$dataurl."readfile.php3?artical_id=$id>$title</a><td>作者:$author </tr>");
// }
}
  }
@mysql_free_result($result);
mysql_close($link_id);
set_time_limit(30);
if($index_title==""){
$index_title="學而齋資料";
}
$index_title=$index_title."_".$data_search;

$html_header="<html><head><title>$index_title</title></head><body>";
$html_header.="<h5>$index_title</h5>rn";
$dte_created=date('y-m-d h:i:s');
$html_header.="<font color='maroon' face='楷體' size=1>$index_describe 發現了 $count 條/查詢日期:$dte_created</font><hr>rn";
$html_header.="<table>rn";
$data=$html_header.$index_data;
$data.="<table></body></html>";
/*if(strlen($index_file)==0){
header("content-type: text/html");
   echo $data;
   }
   else
   {
$in_file="$index_file";
$index_file="/index/".$index_file;
$fp=indexfile($index_file,$index_title,$index_describe);
fputs($fp, "發現了 $count 條");
fputs($fp, "查詢日期:$dte_created</font><hr>rn");
fputs($fp,"<table>rn");
fputs($fp, $index_data);
fputs($fp, "<table></body></html>");
fclose($fp);
echo"點<a href=$index_url$in_file>這里</a>看新加入的文件索引<br>";
   }
  */
if(strlen($index_file)!=0){
     $in_file="$index_file";
     $index_file="/index/".$index_file;
   }
else
       $in_file="temp.html";
$fp=indexfile($index_file,$index_title,$index_describe);
fputs($fp, "發現了 $count 條");
fputs($fp, "查詢日期:$dte_created</font><hr>rn");
fputs($fp,"<table>rn");
fputs($fp, $index_data);
fputs($fp, "<table></body></html>");
fclose($fp);

//    echo"點<a href=$index_url$in_file>這里</a>看新加入的文件索引<br>";
header("location:$index_url$in_file");
   
    
//echo"索引文件為 $index_file";
echo"<br><a href = $php_self>返回 </a>";

endif;
?> 
發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 且末县| 磴口县| 汤阴县| 清丰县| 丰城市| 万山特区| 太和县| 山阳县| 紫云| 鄂托克前旗| 桐梓县| 府谷县| 康保县| 昌吉市| 福安市| 泉州市| 喀喇沁旗| 武胜县| 鹤岗市| 志丹县| 新建县| 武定县| 宜城市| 白沙| 遂川县| 墨脱县| 永济市| 孟津县| 华阴市| 肃北| 东宁县| 虎林市| 洪泽县| 樟树市| 漳州市| 高碑店市| 久治县| 施秉县| 平阴县| 东辽县| 武山县|