0

次のようにサイトからログアウトするコードがあります:-

if($_GET['do'] == 'logout')
{
session_destroy();
setcookie('us_log_in_r','',time()-3600,'/');
$result["process"] = "ok";

} // end action logout

そして、次のような別のphpファイルのリンクからログアウトします:-

 <li><a href="#" id="logout" onClick="logout_user_();" ><span>Logout</span></a></li>

と私のjquery:-

// This function to logout
function logout_user_(){

    $.ajax({
      url: "request.php?do=logout",
      type: "POST",
      data: {

          },
      dataType: "json",
      success: function(data){
      if(data.process == "ok"){
        $("#error_reg2").show('fast',function(){
                $("#show_reg2").html("success");            
            });
        $("#error_reg2").fadeOut(5000);
        if ($("#error_reg2").fadeOut(5000)){    
        window.setTimeout(function () {
        location.href = "#one";
    }, 5000)
        }
      }
      else
      {
            $("#error_reg2").show('fast',function(){
            $("#show_reg2").html("Error");          
            });       
      }
      }  
      });

}

私のコードのエラーは、ログアウトリンクをクリックすると、このエラーメッセージが送信されます:-

data.process は null です ?? どうして

4

1 に答える 1