Mercurial > hg > LGSearch
changeset 4:c3c31d031945
add passwd in search page
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Thu, 25 Jun 2015 18:29:48 +0200 |
parents | bc6ce492f15d |
children | 1cf7bb8db5dd |
files | search.php |
diffstat | 1 files changed, 18 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/search.php Thu Jun 25 17:43:28 2015 +0200 +++ b/search.php Thu Jun 25 18:29:48 2015 +0200 @@ -2,6 +2,12 @@ include_once('config/Lib_mb_utf8.php'); include_once('config/config.php'); include_once('search_function.php'); + +if ( isset($_POST['passwd']) ) { + $checkPasswd = 0; +} else { + $checkPasswd = 1; +} ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> @@ -15,18 +21,24 @@ <body> <script type="text/javascript"> // prompt to ask the password when open page - var password = "3333"; - var string = prompt("Please enter password", ""); - if(string!=password) { - alert("Wrong password!"); - window.location="http://localgazetteers.mpiwg-berlin.mpg.de"; - } + var checkPasswd = <?php echo $checkPasswd?>; + if (checkPasswd == 1) { + var password = "3333"; + var string = prompt("Please enter password", ""); + if(string!=password) { + alert("Wrong password!"); + window.location="http://localgazetteers.mpiwg-berlin.mpg.de"; + } + } + </script> <form action='search.php' method='POST'> 關鍵字: <input type="text" name="keyword" size="100"> (若要搜尋多筆關鍵字請用半型逗號,隔開)<br> 將結果輸出至: <input type="text" name="filename" size="40">.html (請用英文非空白字元命名)<br> <input type="submit" name="search" value="搜尋"> + <input type="hidden" name="passwd"> + </form> <br> <div id="search_result">