日期:2013-01-30  浏览次数:20593 次

<?
//本程序为一个搜索,目前设计服务于文章库。
//编者:孔秀祥。日期:2001/4/10
if(!$UploadAction):
require "config.php3";
if(!isset($table)){
//$table="artical";
}
/*
$link_id=@MYSQL_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" style="border-style:outset; border-bottom-width:thin; border-left-width:thin;border-right-width:thin;border-top-width:thin; border-color:#fefefe;">
<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);
}


$link_id=@MYSQL_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=