설문조사 기타의견쓰기에 비회원일 경우 캡챠 적용

This commit is contained in:
gnuboard
2013-01-20 17:57:10 +09:00
parent dc0c463be6
commit 703ce0f585
3 changed files with 16 additions and 1 deletions

View File

@ -1,4 +1,5 @@
<?
define('G4_CAPTCHA', 1);
include_once('./_common.php');
$po = sql_fetch(" select * from {$g4['poll_table']} where po_id = '{$po_id}' ");

View File

@ -1,6 +1,11 @@
<?
define('G4_CAPTCHA', 1);
include_once('./_common.php');
if ($is_guest && !chk_captcha()) {
alert('스팸방지에 입력한 숫자가 틀렸습니다.');
}
$po = sql_fetch(" select * from {$g4['poll_table']} where po_id = '{$_POST['po_id']}' ");
if (!$po['po_id'])
alert('po_id 값이 제대로 넘어오지 않았습니다.');

View File

@ -49,7 +49,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<? } ?>
<? if ($member['mb_level'] >= $po['po_level']) { ?>
<form name="fpollresult" method="post" action="./poll_etc_update.php" autocomplete="off">
<form name="fpollresult" method="post" action="./poll_etc_update.php" onsubmit="return fpollresult_submit(this);" autocomplete="off">
<input type=hidden name="po_id" value="<?=$po_id?>">
<input type=hidden name="w" value="">
<input type=hidden name="skin_dir" value="<?=$skin_dir?>">
@ -66,6 +66,7 @@ if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
<? } ?>
<input type="text" id="pc_idea" name="pc_idea" class="fieldset_input required" size="<?=$comment_size?>" required maxlength="100" title="의견">
<input type="submit" class="fieldset_submit" value="의견남기기">
<? if ($is_guest) { echo captcha_html(); } ?>
</fieldset>
</form>
<? } ?>
@ -90,5 +91,13 @@ $(function() {
$(".btn_win a").click(function() {
window.close();
});
});
function fpollresult_submit(f)
{
<? if ($is_guest) { echo chk_captcha_js(); } ?>
return true;
}
</script>