2
The registration form sends the data by ajax, the captcha is completed correctly, and the token is given also as I could verify by the command. However when submitting the form I see that the value is empty.
Ajax code
var dados = new FormData(this);
jQuery.ajax({ //Função AJAX
url:"login-system/registrar.php", //Arquivo php
type:"post", //Método de envio
data: dados, //Dados
dataType: 'json',
processData: false,
cache: false,
contentType: false,
beforeSend: function(){ jQuery("#registrar").html('Criando Cadastro...');},
success: function (result){ //Sucesso no AJAX
jQuery("#registrar").html('Registrar');
Form
<form action="#" id="form" method="post">
<input type="hidden" name="csrf_token" value="<?php echo $secure->reg_token(); ?>" />
<label id="status" style="display:none;color:red;"></label>
<div class="form-group">
<label>Usuário</label>
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-user"></i></div>
<input type="text" id="usuario" name="usuario" onkeyup="mascara( this, alphanum )" onkeypress="document.getElementById('errouser').innerHTML = '';" maxlength="8" class="form-control" placeholder="Usuário (Utilizado para Login)" autocomplete="off">
</div>
<span class="help-block" id="errouser"></span>
</div>
<div class="form-group">
<label>Senha</label>
<div class="input-group">
<div class="input-group-addon"><i class="fa fa-asterisk"></i></div>
<input type="password" id="senha" name="senha" onkeyup="validatepass(this);" maxlength="12" class="form-control" placeholder="Senha (Utilizado para Login)" autocomplete="off">
</div>
<span class="help-block" id="erropass"></span>
</div>
<div class="form-group">
<label>Repita a Senha</label>
<div class="input-group">
<div class="input-group-addon"><i class="ti ti-back-right"></i></div>
<input type="password" id="repsenha" name="repitasenha" onkeyup="validaterep(this);" maxlength="12" class="form-control" placeholder="Repita a Senha" autocomplete="off">
</div>
<span class="help-block" id="errorepsenha"></span>
</div><div class="form-group">
<label>E-mail</label>
<div class="input-group">
<div class="input-group-addon"><i class="ti ti-email"></i></div>
<input type="email" id="email" name="email" onkeyup="document.getElementById('erroemail').innerHTML = '';" maxlength="30" class="form-control" placeholder="E-mail de Segurança (Recuperação de Senha)" autocomplete="off">
<label>Verificação de Segurança</label>
<div class="g-recaptcha" data-sitekey="6Lev8WUUAAAAADY1OAgqFezg4Jb-TAUiv5s3Y0el" data-callback="recaptcha"></div>
<span class="help-block" id="errocaptcha"></span>
</div>
<button type="submit" id="registrar" class="btn btn-success btn-flat m-b-30 m-t-30">Registrar-se</button>
<div class="register-link m-t-15 text-center">
<p>Possui conta? <a href="login.php"> Logue-se!</a></p>
</div>
</form>