AndrewM16921 Posted June 8, 2013 Share Posted June 8, 2013 Hey, So I'm trying to teach myself how to use json with php, made a simple example. I have a script on the browser side var data = JSON.stringify({'username':user,'password':pass});$.ajax({ url: 'login.php', type: 'POST', data: data, contentType: 'application/json; charset=utf-8', dataType: 'json', success: function(result) { alert(result); }}); So, in login.php how do I access the data I sent? Is it in the $_POST array? And if so... what's mapped to it? I know there's the json_decode/encode functions, but my problem is finding the object to use it on and I have no idea. O_o Help appreciated. Thanks. Link to comment Share on other sites More sharing options...
AndrewM16921 Posted June 9, 2013 Author Share Posted June 9, 2013 Think I figured it out. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now