目前,在我的表格已通过验证后,它将其转发到HTML页面。

我想实现一个最后一步,可以拉recaptcha,只有在通过recaptcha传递时,只有那时发送到我的数据库的用户的注册详细信息,然后将用户转发到我选择的页面。

请告知我最好的方法。

这是我的JavaScript和Ajax。 cumber.php是一个保留我所有验证规则的文件。我想我现在必须有一个容纳我的验证码并使用Ajax获取该文件的文件,或者有更好的方法。我还在学习。

$(document).ready(function(){

        $('#fhjoinForm').submit(function(e) {

            register();
            e.preventDefault();

        });

    });


    function register()
    {
        hideshow('loading',1);
        error(0);

        $.ajax({
            type: "POST",
            url: "submit.php",
            data: $('#fhjoinForm').serialize(),
            dataType: "json",
            success: function(msg){

                if(parseInt(msg.status)==1)
                {
                    window.location=msg.txt;
                }
                else if(parseInt(msg.status)==0)
                {
                    error(1,msg.txt);
                }

                hideshow('loading',0);
            }
        });

    }


    function hideshow(el,act)
    {
        if(act) $('#'+el).css('visibility','visible');
        else $('#'+el).css('visibility','hidden');
    }

    function error(act,txt)
    {
        hideshow('error',act);
        if(txt) $('#error').html(txt);
    }
有帮助吗?

解决方案

因此,在提交之前,必须有一种简单的方法来添加Recaotcha作为我注册表格的最后一步。

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top