Mercurial > hg > LGSearch
annotate search.php @ 2:45cbafdec56e
modified code for updated db tables
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Wed, 25 Mar 2015 16:03:54 +0100 |
parents | c9363a90b8b5 |
children | bc6ce492f15d |
rev | line source |
---|---|
0
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
1 <?php |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
2 |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
3 include_once('config/Lib_mb_utf8.php'); |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
4 include_once('config/config.php'); |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
5 include_once('search_function.php'); |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
6 |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
7 ?> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
8 |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
9 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
10 <html> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
11 <head> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
12 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
13 <link href="search.css" type="text/css" rel="stylesheet"/> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
14 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" type="text/javascript"></script> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
15 <script src="search.js" charset="utf-8"></script> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
16 </head> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
17 <body> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
18 <form action='search.php' method='POST'> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
19 關鍵字: <input type="text" name="keyword" size="100"> (若要搜尋多筆關鍵字請用半型逗號,隔開)<br> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
20 將結果輸出至: <input type="text" name="filename" size="40">.html (請用英文非空白字元命名)<br> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
21 <input type="submit" name="search" value="搜尋"> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
22 </form> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
23 <br> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
24 <div id="search_result"> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
25 <?php |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
26 if(isset($_POST['search']) && $_POST['keyword']!='' && $_POST['filename']!=''){ |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
27 $keywordArray=trimKeyword($_POST['keyword']); |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
28 $array=search($keywordArray); |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
29 writeCsvFile($array,$_POST['filename']); |
2
45cbafdec56e
modified code for updated db tables
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
0
diff
changeset
|
30 // write html to search_results folder |
0
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
31 printTable($array,$keywordArray,$_POST['filename'],$NO_TAG); |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
32 } |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
33 ?> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
34 </div> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
35 </body> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
36 </html> |
c9363a90b8b5
first commit to development server
Zoe Hong <zhong@mpiwg-berlin.mpg.de>
parents:
diff
changeset
|
37 |