php - codeignitor function load two pages of same function calls in different ways -
I am using two methods for user login in codeigniter:
- URL is typed as if the local host / mySite
is calling the function when I am following Step 2, then this localhost / msiteite / login
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
Post a Comment