Jump to content

Using returnValues with an array problems


phpjayx

Recommended Posts

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

{..........................

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.