全国人民代表大会コピーデータ処理プログラム_Query_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") または die("データベースを選択できません!"); = "$table から count(id) を選択します。ここで 1 ";
$result = @mysql_query($q)
$row = @mysql_fetch_array($result); ;
*/
?>
<HTML><TITLE>データベース検索</TITLE>
<BODY<table align=center cellpadding="0" cellpacing="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;">
<THcolspan=2 bgcolor=726cc5>
<!--tr><tdcolspan=2 bgcolor=726cc5-->
<font color=white face=Arial,Helvetica size=2>
<CENTER> このプログラムは実行に時間がかかるため、辛抱強く待つ必要があります。 </TH>
<FORM ENCTYPE= "multipart/form-data" NAME = "SubmitForm"
ACTION= "<? $PHP_SELF ?>"
<!--入力タイプ = "非表示" 名前 = "MAX_FILE_SIZE" 値 ="2500000"-->
<入力タイプ = "非表示" 名前 = "アップロードアクション" 値 = "1">
<入力タイプ = "非表示"名前 = "テーブル" 値 = "<? echo $table; ?>
<input type="hidden" name=table value="artical"> tdcolspan=2 align=center>クエリ項目
<tr><tdcolspan=2 align=center><input type="radio" name=a_data value="data" selected>記事内容
<input type ="ラジオ" name=a_data value="title">記事タイトル
<input type="radio" name=a_data value="author">記事著者
<input type="radio" name=a_data value ="月" >雑誌名
<!--input type="radio" name=a_data value="type" >カテゴリ番号<BR-->検索コンテンツ< ;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>
<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 --> > ;INPUT NAME = "リセット" VALUE = "リセット" ></TD></TR>
</FORM></CENTER>
< die=0;
$single_chinese=0;
$TimeLimit=0; /*タイムアウト制限を設定します。デフォルトの時間は 0 に設定すると無制限になります*/
set_time_limit ;
if($data_search ==""){
// データベース全体のインデックスを作成します
header("location:progsdata_index.php3");
//$msg="検索内容を空にすることはできません。"; /xueroom_error_exit($msg,$ PHP_SELF);
}
$link_id=@MYSQL_CONNECT($hostname,$dbusername,$dbpassword) OR DIE("データベースに接続できません! ");
@mysql_select_db("$dbname") または die("データベースを選択できません!");
//SELECT id,file_name,artical_author from textfile where 1 LIMIT 0, 30
if($table=="artical" )
{
$stitle="artical_title"
$sdata="artical_data"
if($a_data) == "月" )
$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 は '^.*$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 .*'$stitle 順に並べる";
if(($a_data=="data")&&(strlen($data_search)==2)){
$q="$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) ))
else
{
$id=$row[$stitle];
$author=$row[$sauthor]; 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>作者:$著者 ");
// }
}
}
@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_file;
$fp=indexfile($index_file,$index_title,$index_describe);
fputs($fp, "発行现了 $count 条");
fputs($fp, "查询日期:$dte_created</font><hr>rn");
fputs($fp,"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_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,"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;
?>

人気の記事

人気の記事

ホットな記事タグ

メモ帳++7.3.1
使いやすく無料のコードエディター

SublimeText3 中国語版
中国語版、とても使いやすい

ゼンドスタジオ 13.0.1
強力な PHP 統合開発環境

ドリームウィーバー CS6
ビジュアル Web 開発ツール

SublimeText3 Mac版
神レベルのコード編集ソフト(SublimeText3)

ホットトピック











Weiboで過去のWeiboを日付で検索する方法_Weiboで過去のWeiboを日付で検索する方法

レトロトレンド! HMDとハイネケンが共同で折りたたみ式携帯電話を発売:透明なシェルデザイン

12306 過去のチケット購入記録の確認方法 過去のチケット購入記録の確認方法
