开发者

JS/PHP: Wont alert error

开发者 https://www.devze.com 2023-01-09 14:18 出处:网络
<script type=\"text/javascript\"> $(function() { $(\"#continue\").click(function () { $.ajax({ type: \"P开发者_开发技巧OST\",
    <script type="text/javascript">
    $(function() {
  $("#continue").click(function () {
    $.ajax({
       type: "P开发者_开发技巧OST",
       url: "dbc.php?check=First",
    data: {full_name : $('#full_name').val(),
         usr_email : $('#usr_email').val()},

       success: function(msg){
            if(msg==1){
              $("#First_1").hide();
              $("#Next_2").toggle(); 
           }else{
              alert(msg);
           }         
        }
     });
     return false;
  });
}); 
    </script>

Here's dbc.php?check=First phpbin.net/x/249121011

if it´s receiving echo 1; from dbc.php?check=First, then hide & toggle, else then alert the output error.

Please check the link for the php, what is wrong here?

Right now i just get an empty alert.


$_POST['check'] is never set, thus your code isn't being called, thus nothing is output. Either remove the check for $_POST['check'] in your PHP script, add check: 'First' to the data property to the $.ajax call, or change $_POST to $_GET.

0

精彩评论

暂无评论...
验证码 换一张
取 消