2015-10-15 64 views
1

這對是鏈接到我的網站:登錄和註冊工作不活的服務器

http://210.48.154.18/~econtrax/ezy/index.php 

奇怪的是,我無法進入管理的儀表盤頁面上傳後到現場服務器。我不知道爲什麼我無法通過此登錄和註冊功能。

我確保數據中存在數據。並注意到在網絡選項卡中,頁面被訪問,但只是不工作!在控制檯標籤錯誤被拋出,但我不知道如何解決它們。

請問有人能幫我解決這個問題。您可以嘗試登錄與以下:

電子郵件:[email protected] 密碼:admin

或者,你可以嘗試創建一個新用戶!

非常感謝!

我的登錄腳本:在控制檯選項卡中找到F12

/*login user*/ 
<!--login form submission starts--> 
$("document").ready(function() { 
    $("#login-user").submit(function() { 
    var data = { 
     "action": "test" 
    }; 

    data = $(this).serialize() + "&" + $.param(data); 
    $.ajax({ 
     type: "POST", 
     dataType: "json", 
     url: "login-this-user.php", 
     data: data, 
     success: function (data) { 
     alert(data); 
     console.log(data); 
     for (i = 0; i < data.length; i++) { 
      console.log(data[i].email); 
      console.log(data[i].activate); 
      console.log(data[i].status); 

      if ($.trim(data[i].status) == '0') { 
      //alert("not verified"); 
      $('.invalid-popup-link').trigger('click'); 

      } else { 
      //alert("verified"); 
      location.replace("admin/dashboard.php"); 

      } 
     } //end for 

     }, 
     error: function (jqXhr, textStatus, errorThrown) { 
     console.log(errorThrown); 
     } 
    }); 
    return false; 
    }); 
}); 
<!--login form submission ends--> 

錯誤

SyntaxError: Unexpected token e at Object.parse (native) at e.extend.parseJSON (http://210.48.154.18/~econtrax/ezy/js/jquery-1.7.1.min.js:2:11020) at cc (http://210.48.154.18/~econtrax/ezy/js/jquery-1.7.1.min.js:2:1382) at w (http://210.48.154.18/~econtrax/ezy/js/jquery-1.7.1.min.js:4:11263) at XMLHttpRequest.f.support.ajax.f.ajaxTransport.send.d (http://210.48.154.18/~econtrax/ezy/js/jquery-1.7.1.min.js:4:17218)

最新出錯 錯誤使用jQuery版本替換2.1.4

SyntaxError: Unexpected end of input at Object.parse (native) at n.parseJSON (http://210.48.154.18/~econtrax/ezy/js/jquery-2.1.4.min.js:4:5497) at ub (http://210.48.154.18/~econtrax/ezy/js/jquery-2.1.4.min.js:4:7521) at x (http://210.48.154.18/~econtrax/ezy/js/jquery-2.1.4.min.js:4:10935) at XMLHttpRequest.n.ajaxTransport.k.cors.a.crossDomain.send.b (http://210.48.154.18/~econtrax/ezy/js/jquery-2.1.4.min.js:4:14765)

+0

首先,jQuery 1.7是古老的。使用當前版本的jQuery。 –

+0

@EdCottrell我改爲2.1.4版仍然不能更新這個時候在我的帖子中拋出的錯誤 –

回答

2

我試圖拋出後通過替換

error: function (jqXhr, textStatus, errorThrown) { 

error: function (errorThrown) { 

有控制檯沒有錯誤,輸出爲

Object {readyState: 4, responseText: " ", status: 200, statusText: "OK"} 
+0

@我也試過了,但是responsText返回空了.. –

0

意外標記e - 開始從Java控制你的信息,是來自服務器,而不是有效的JSON字符串。嘗試返回可解析的東西:

$arr = array('a' => 1, 'b' => 2, 'c' => 3, 'd' => 4, 'e' => 5); 
echo json_encode($arr); 
+0

$ activated_id = array(); foreach($ profile = $ k => $ v)array_push($ activated_id,array(「email」=> $ v ['email'],「activate」=> $ v ['activate'],「status 「=> $狀態)); $ _SESSION ['email'] = $ v ['email']; $ _SESSION ['activated_id'] = $ v ['activate']; } echo json_encode($ activated_id); –

+0

我像上面解析但responseText返回空,但在本地主機作品...你知道爲什麼請嗎? –