Mercurial > hg > LGSearch
comparison search_function.php @ 5:1cf7bb8db5dd
modify passwd popup
author | Zoe Hong <zhong@mpiwg-berlin.mpg.de> |
---|---|
date | Mon, 12 Oct 2015 15:36:13 +0200 |
parents | bc6ce492f15d |
children | 23dcd1b5e9c4 |
comparison
equal
deleted
inserted
replaced
4:c3c31d031945 | 5:1cf7bb8db5dd |
---|---|
1 <?php | 1 <?php |
2 | |
3 include_once('config/Lib_mb_utf8.php'); | 2 include_once('config/Lib_mb_utf8.php'); |
4 include_once('config/config.php'); | 3 include_once('config/config.php'); |
5 | 4 |
6 set_time_limit(0); | 5 set_time_limit(0); |
7 ini_set('memory_limit', '-1'); | 6 ini_set('memory_limit', '-1'); |
15 | 14 |
16 $db_selected = mysql_select_db($mysql_database, $link_mysql); | 15 $db_selected = mysql_select_db($mysql_database, $link_mysql); |
17 if (!$db_selected) { | 16 if (!$db_selected) { |
18 die ('Can\'t use foo : ' . mysql_error()); | 17 die ('Can\'t use foo : ' . mysql_error()); |
19 } | 18 } |
19 | |
20 | |
21 $func = $_POST["func"]; | |
22 switch ($func) { | |
23 case 'checkPassword': | |
24 checkPassword($_POST["password"]); | |
25 break; | |
26 default: | |
27 break; | |
28 } | |
29 | |
30 function checkPassword($passwd){ | |
31 global $password; | |
32 if ($password == $passwd) { | |
33 echo 1; | |
34 } else { | |
35 echo 0; | |
36 } | |
37 } | |
38 | |
20 function trimKeyword($keywords){ | 39 function trimKeyword($keywords){ |
21 $token=strtok($keywords,","); | 40 $token=strtok($keywords,","); |
22 while($token!=false){ | 41 while($token!=false){ |
23 $token=trim($token); | 42 $token=trim($token); |
24 $keywordArray[]=$token; | 43 $keywordArray[]=$token; |