Help with JSON (neophp login result) - Forum

Forum Navigation
You need to log in to create posts and topics.

Help with JSON (neophp login result)

When you log in program it returns data : id, username, email, level, error

But when i want to put [data('username')] in a variable, i can't. i tried:

[data(0)('username')]
[data(0).username]
[data.username]
[data('username')]
...

{"id":"5","name":"","email":"test@test.test","level":"1","error":"","0":"5","username":"blah3","1":"blah3","password":"pass","2":"pass","3":"test@test.test","4":"1","creation_time":"2022-03-06 23:22:28","5":"2022-03-06 23:22:28"}

Thats result i get for login.
(I dont know why some of them doubled?!)

Anyone knows how to get "username" or "error" data in a variable?
Thanks.

@noyzen please take a look at this video (minute 3)

Regards.

Vadim and noyzen have reacted to this post.
Vadimnoyzen
CreateEmptyObject [userinfo]
ParseJSON "[data]" [userinfo]
jsAlert "[userinfo.username]"

Job Done! so easy and i wasted a day for it :D

I have seen all videos before but i forgot that part...

Thank you Luis as always peoblem solved.


This wordfence on site shows a lot of error to me and i cant edit my post to mark it as [SOLVED], maybe i have to try later again

luishp has reacted to this post.
luishp