리자

자동등록방지 코드

<script src="<?=$g4[path]?>/js/jquery.js"></script>
<script src="<?=$g4[path]?>/js/md5.js"></script>


<form id='fjoin' action='join_form.php' method='post'>
    <img id='kcaptcha_image' border='0' width=120 height=60 style="cursor:pointer;" title="글자가 잘안보이는 경우 클릭하시면 새로운 글자가 나옵니다.">
    <input class='ed' type='input' size='10' id='wr_key' name='wr_key' itemname="자동등록방지">&nbsp;&nbsp;왼쪽의 글자를 입력하세요.
    <input type=submit>
</form>


<script type="text/javascript"> var md5_norobot_key = ''; </script>
<script type="text/javascript">
$(document).ready(function() {
    $('#kcaptcha_image').click(function() {
        $.post('<?=$g4[bbs_path]?>/kcaptcha_session.php', function(data) {
            $('#kcaptcha_image').attr('src', '<?=$g4[bbs_path]?>/kcaptcha_image.php?t=' + (new Date).getTime());
            md5_norobot_key = data;
        });
    });

    $('#kcaptcha_image').click();

    $('#fjoin').submit(function() {
        if ($('#wr_key') != 'undefined') {
            if (hex_md5($('#wr_key').val()) != md5_norobot_key) {
                alert('자동등록방지용 글자가 제대로 입력되지 않았습니다.');
                $('#wr_key').select().focus();
                return false;
            }
        }

        return true;
    });
});
</script>

[이 게시물은 관리자님에 의해 2011-10-31 16:55:28 jQuery에서 이동 됨]
|

댓글 2개

이렇게 캐차가 바뀌네요 *^^*
풍선도움말 예제도 하나... 굽신굽신...
테스트 해봤네요 좋네요 관리자님 감사 ㅋㅋ
댓글을 작성하시려면 로그인이 필요합니다. 로그인

개발자팁

개발과 관련된 유용한 정보를 공유하세요. 질문은 QA에서 해주시기 바랍니다.

+
분류 제목 글쓴이 날짜 조회
기타 17년 전 조회 3,378
MySQL 17년 전 조회 3,564
MySQL 17년 전 조회 3,784
jQuery 17년 전 조회 4,947
jQuery 17년 전 조회 3,613
jQuery 17년 전 조회 2,952
jQuery 17년 전 조회 5,715
jQuery 17년 전 조회 4,816
jQuery 17년 전 조회 5,437
JavaScript 17년 전 조회 5,169
기타 17년 전 조회 4,012
jQuery 17년 전 조회 4,017
jQuery 17년 전 조회 4,194
jQuery 17년 전 조회 4,490
jQuery 17년 전 조회 4,221
jQuery 17년 전 조회 2,681
기타 17년 전 조회 2,801
JavaScript 17년 전 조회 2,680
jQuery 17년 전 조회 3,455
jQuery 17년 전 조회 4,190
jQuery 17년 전 조회 1.1만
기타 17년 전 조회 1.1만
JavaScript 17년 전 조회 3,201
PHP 17년 전 조회 2,889
기타 17년 전 조회 2,839
JavaScript 17년 전 조회 2,270
기타 17년 전 조회 2,460
JavaScript 17년 전 조회 2,703
기타 17년 전 조회 3,263
기타 17년 전 조회 1,999
🐛 버그신고