phpjayx Posted February 3, 2013 Share Posted February 3, 2013 The below function is when I have my users log on. I've been working on this for hours, still unable to figure it out.... When I login with a valid user ID, it correctly logs in... My problem is getting the Alerts to work. When my data did not have mulitple return values it worked... but now that I added the additional parameter from the PHP file, the alerts do no work anymore.... I've attempted to use a $.parseJSON statement on the returnValue, but that doesn't work.....I don't know how to get at the "false" or "-1" output Any suggestions???? Please -------------------------------------------------the return statement from my PHP file return $json.'^'.$json1; -------------------my debugger output when entering an invalid password ^false --------------------------------------------------------- My .js file function onSuccessLogin(data) { var temp = data.split("^"); var returnValue = temp[1]; var returnValue2 = temp[2]; parseDataJson(returnValue2); if (returnValue == 'false') alert('Login fail'); else { if (returnValue == '-1') { alert('You need to click on your email confirmation first'); } else {.......................... Quote Link to comment https://forums.phpfreaks.com/topic/273971-using-returnvalues-with-an-array-problems/ Share on other sites More sharing options...
phpjayx Posted February 3, 2013 Author Share Posted February 3, 2013 Ignore... I figured it out..... Almost the same code.... I didn't realize it was stopping on the error within the function parseDataJson(returnValue2); So I just had to move that line down in the else statement........... Quote Link to comment https://forums.phpfreaks.com/topic/273971-using-returnvalues-with-an-array-problems/#findComment-1409823 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.