목차
$index_title
백엔드 개발 PHP 튜토리얼 人大复印资料处理程序_查询篇_PHP教程

人大复印资料处理程序_查询篇_PHP教程

Jul 21, 2016 pm 04:05 PM
~을 위한 다루다 복사 도서관 찾다 기사 날짜 질문 현재 프로그램 설계 재료


//本程序为一个搜索,目前设计服务于文章库。
//编者:孔秀祥。日期: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)"];
*/   

?>

数据库搜索




ACTION= " $PHP_SELF ?>" METHOD = "POST">
















本程序运行较费时间,需要耐心等待。
查询项目
文章内容
文章标题
文章作者
期刊名

搜索内容
索引文件名
索引标题
文章分类









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="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 =@ 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.=" $title 作者:$author ";
      $count++;
  //fputs($fp, " $title 作者:$author ");
// }
}
  }
@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="$index_title";
$html_header.="
$index_title
rn";
$dte_created=date('Y-m-d H:i:s');
$html_header.="$index_describe 发现了 $count 条/查询日期:$dte_created
rn";
$html_header.="rn";
$data=$html_header.$index_data;
$data.="
";
/*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
rn");
fputs($fp,"
rn");
fputs($fp, $index_data);
fputs($fp, "
본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

뜨거운 기사 태그

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

iPhone에서 Google 지도를 기본 지도로 설정하는 방법 iPhone에서 Google 지도를 기본 지도로 설정하는 방법 Apr 17, 2024 pm 07:34 PM

iPhone에서 Google 지도를 기본 지도로 설정하는 방법

웨이보에서 이전 웨이보를 날짜별로 검색하는 방법_웨이보에서 이전 웨이보를 날짜별로 검색하는 방법 웨이보에서 이전 웨이보를 날짜별로 검색하는 방법_웨이보에서 이전 웨이보를 날짜별로 검색하는 방법 Mar 30, 2024 pm 07:26 PM

웨이보에서 이전 웨이보를 날짜별로 검색하는 방법_웨이보에서 이전 웨이보를 날짜별로 검색하는 방법

CPU를 너무 많이 점유하는 WIN10 서비스 호스트의 동작 과정 CPU를 너무 많이 점유하는 WIN10 서비스 호스트의 동작 과정 Mar 27, 2024 pm 02:41 PM

CPU를 너무 많이 점유하는 WIN10 서비스 호스트의 동작 과정

Xuexin.com에서 학업 자격을 확인하는 방법 Xuexin.com에서 학업 자격을 확인하는 방법 Mar 28, 2024 pm 04:31 PM

Xuexin.com에서 학업 자격을 확인하는 방법

레트로 트렌드! HMD와 하이네켄, 투명 쉘 디자인 플립폰 공동 출시 레트로 트렌드! HMD와 하이네켄, 투명 쉘 디자인 플립폰 공동 출시 Apr 17, 2024 pm 06:50 PM

레트로 트렌드! HMD와 하이네켄, 투명 쉘 디자인 플립폰 공동 출시

iPhone에 시계 앱이 없습니다. 해결 방법 iPhone에 시계 앱이 없습니다. 해결 방법 May 03, 2024 pm 09:19 PM

iPhone에 시계 앱이 없습니다. 해결 방법

12306 항공권 구매 내역 확인 방법 항공권 구매 내역 확인 방법 12306 항공권 구매 내역 확인 방법 항공권 구매 내역 확인 방법 Mar 28, 2024 pm 03:11 PM

12306 항공권 구매 내역 확인 방법 항공권 구매 내역 확인 방법

PPT 유인물에서 인쇄할 때 자동으로 나타나는 날짜를 제거하는 방법 PPT 유인물에서 인쇄할 때 자동으로 나타나는 날짜를 제거하는 방법 Mar 26, 2024 pm 08:16 PM

PPT 유인물에서 인쇄할 때 자동으로 나타나는 날짜를 제거하는 방법

See all articles