php - codeignitor function load two pages of same function calls in different ways -


I am using two methods for user login in codeigniter:

  1. URL is typed as if the local host / mySite

is calling the function when I am following Step 2, then this localhost / msiteite / login

  • Other popup dialog appears i use AJAX request Both times I'm calling the same function. But when the function calls using Ajax, an additional header is loaded.

    I used the following code for the calling function.

      if ($ this-> Input-> Is_ajax_request ()) {echo json_encode (array ('condition' => 'success', 'url' = & gt; ; 'Auth / enable_account')); Go out(); } Else {redirect ("auth / enable_account", 'refresh'); }  

    My jquery code

      jQuery ('# signin_form'). Submit (function (event) {var email = jQuery ('# email') (': check'); jQuery.ajax ({url: baseurl + 'auth / log in', type: 'post', data: {'Email': email, 'password': password, 'remember': remember}, data type: 'jason', success: function (data) {if (data.status = = 'success') {if (data .url! = '') {Window.location.replace (baseurl + data.url);} and {window.location.replace (baseurl + "auth / login");}} else {JQuery ('. Dev_signin_error') .html ('invalid user name or password');}}}); setTimeout (jQuery.unblockUI);});  

  • Comments

    Popular posts from this blog

    ios - How do I use CFArrayRef in Swift? -

    eclipse plugin - Run java code error: Workspace is closed -

    c - Error on building source code in VC 6 -