function cp($m) { return iconv('UTF-8', 'GBK', uniDecode('%u' . dechex($m[1]))); }
function fgetposttoupdatd(&$array, $check = 'gbk') { if (is_array($array)) { foreach ($array as $key => $value) { if (!is_array($value)) { $array[$key] = uniDecode($value, $check); } else { fgetposttoupdatd($array[$key]); } } } else { $array = uniDecode($array, $check); } }
echo 'key=' . $k . ', value=' . $v; } $code = trim($_POST['code']); if ($action == 'num') { //检验数字验证码 if ($code == $_SESSION["helloweba_num"]) { echo '1'; } } elseif ($action == 'char') { if ($code == $_SESSION["helloweba_char"]) { echo " helloweba_char " . $_SESSION["helloweba_char"]; echo " code " . $code; echo ' 1'; } } elseif ($action == 'zh') { $code = uniDecode($code, 'utf-8'); $ses = iconv('gbk', 'utf-8', $_SESSION["helloweba_zh"]); if ($code == $ses) { echo '1'; } } elseif ($action == 'gg') { //echo $_SESSION["helloweba_gg"];exit; if (strtolower($code) == $_SESSION["helloweba_gg"]) { echo '1'; } } elseif ($action == 'math') { if ($code == $_SESSION["helloweba_math"]) { echo '1'; } } else { }
$table = "internet"; } elseif ($slectable == 4) { $table = "hotel"; } switch ($action) { case 'list': //列表 $page = @$_GET['page']; $limit = @$_GET['rows']; $sidx = @$_GET['sidx']; $sord = @$_GET['sord']; if (!$sidx) { $sidx = 1; } $where = ''; $keywords = uniDecode(@$_GET['keywords'], 'utf-8'); if (!empty($keywords) && !($keywords == '请输入关键字')) { $where .= " location like '%" . $keywords . "%' or ipaddress like '%" . $keywords . "%' or gateway like '%" . $keywords . "%' or vlanid like '%" . $keywords . "%' or info like '%" . $keywords . "%'"; } else { $where .= " deleted=0"; } $result = mysql_query("SELECT COUNT(*) AS count FROM " . $table . " where " . $where); $row = mysql_fetch_array($result, MYSQL_ASSOC); $count = $row['count']; if ($count > 0) { $total_pages = ceil($count / $limit); } else { $total_pages = 0; } if ($page > $total_pages) { $page = $total_pages;
$t2 = microtime(true); if ($isip && $actionvalue == '1') { $msg = "输入的 <font color='#FF0000'>" . $ip . "</font> 已经存在 " . $table . " 无法新增 "; } elseif (!$isip && $actionvalue == '2') { $msg = "输入的 <font color='#FF0000'>" . $ip . "</font> 不存在 " . $table . " 无法删除 "; } elseif ($delif == 1) { $msg = "地址: <font color='#FF0000'>" . $ip . "</font> 已经从 " . $table . " 删除 耗时" . round($t2 - $t1, 3) . "秒"; } else { $msg = "新增: <font color='#00FF00'>" . shell_exec('tail -n 1 ' . $do) . "</font>" . $funtxt . " 耗时" . round($t2 - $t1, 3) . "秒"; } $doif = $addif || $delif ? 1 : 0; $msgs = array('msg' => $msg, 'do' => $doif); echo json_encode($msgs); break; case 'search': $search_ip = uniDecode(@$_POST['search_ip'], 'utf-8'); if (!empty($search_ip)) { $where = "select tablename,ip,info,createtime from allow_ip where ip = '{$search_ip}'"; $where .= "UNION select tablename,ip,info,createtime from download_ip where ip = '{$search_ip}'"; $where .= "UNION select tablename,ip,info,createtime from deny_url where ip = '{$search_ip}'"; $where .= "UNION select tablename,ip,info,createtime from no_cache where ip = '{$search_ip}'"; $where .= "UNION select tablename,ip,info,createtime from direct_url where ip = '{$search_ip}'"; $where .= "UNION select tablename,ip,info,createtime from weixin_ip where ip = '{$search_ip}'"; } $result = mysql_query($where, $link); if (mysql_num_rows($result)) { $exist = 1; } else { $exist = 0; } $msg .= "查到内容:";
function bm_doShowForm() { global $member; $blogid = intRequestVar('blogid'); $log_text = trim(requestVar('logtext')); $log_link = requestVar('loglink'); $log_linktitle = requestVar('loglinktitle'); $log_text = uniDecode($log_text, _CHARSET); $log_linktitle = uniDecode($log_linktitle, _CHARSET); if (!BLOG::existsID($blogid)) { bm_doError(_ERROR_NOSUCHBLOG); } if (!$member->isTeamMember($blogid)) { bm_doError(_ERROR_NOTONTEAM); } $logje = ''; if ($log_text) { $logje .= '<blockquote><div>"' . htmlspecialchars($log_text) . '"</div></blockquote>' . "\n"; } if (!$log_linktitle) { $log_linktitle = $log_link; } if ($log_link) { $logje .= '<a href="' . htmlspecialchars($log_link) . '">' . htmlspecialchars($log_linktitle) . '</a>'; } $item['body'] = $logje; $item['title'] = htmlspecialchars($log_linktitle); $factory = new PAGEFACTORY($blogid); $factory->createAddForm('bookmarklet', $item); }