if ($MAC['other']['gbookverify'] == 1 && $_SESSION["code_gbook"] != $g_code) { alert('验证码错误'); exit; } if (getTimeSpan("last_gbooktime") < $MAC['other']['gbooktime']) { alert('请不要频繁操作'); exit; } $pattern = '/[^\\x00-\\x80]/'; if (!preg_match($pattern, $g_content)) { alert('内容必须包含中文,请重新输入!'); exit; } $g_name = badFilter($g_name); $g_name = strip_tags($g_name); $g_content = badFilter($g_content); $g_content = strip_tags($g_content); $g_ip = ip2long(getIP()); $g_time = time(); if ($MAC['other']['gbookaudit'] == 1) { $g_hide = 1; } else { $g_hide = 0; } if (strlen($g_name) > 64) { $g_name = substring($g_name, 64); } if (strlen($g_content) > 255) { $g_content = substring($g_content, 255); } $db = new AppDb($MAC['db']['server'], $MAC['db']['user'], $MAC['db']['pass'], $MAC['db']['name']);
if ($MAC['other']['commentverify'] == 1 && $_SESSION["code_comment"] != $c_code) { echo '验证码错误'; exit; } if (getTimeSpan("last_commenttime") < $MAC['other']['commenttime']) { echo '请不要频繁操作'; exit; } $pattern = '/[^\\x00-\\x80]/'; if (!preg_match($pattern, $c_content)) { echo '内容必须包含中文,请重新输入!'; exit; } $c_name = badFilter($c_name); $c_name = strip_tags($c_name); $c_content = badFilter($c_content); $c_content = strip_tags($c_content); $c_ip = ip2long(getIP()); $c_time = time(); if ($MAC['other']['commentaudit'] == 1) { $c_hide = 1; } else { $c_hide = 0; } if (strlen($c_name) > 64) { $c_name = substring($c_name, 64); } if (strlen($c_content) > 255) { $c_content = substring($c_content, 255); } $db = new AppDb($MAC['db']['server'], $MAC['db']['user'], $MAC['db']['pass'], $MAC['db']['name']);