I’m a bit blank in PHP, and having trouble getting the JavaScript equivalent to the PHP Example.
When using the code below i get : Error: $_POST[‘s2member_pro_remote_op’] is NOT a serialized array.
var postData;
function authenticateUser(apiKey, userName, passWord) {
var output = {};
output["op"] = "auth_check_user";
output["api_key"] = apiKey;
var authArray = {"user_login": userName, "user_pass":passWord};
output["data"] = authArray;
postData = JSON.stringify(output);
$.ajax({
url: "http://www.mydomain.com/?s2member_pro_remote_op=1",
type: "POST",
contentType: "application/x-www-form-urlencoded", // send as JSON
data: { "s2member_pro_remote_op": postData }, //ur data to be sent to server
success: function (data) {
result = $.parseJSON(data.d);
return result;
},
error: function (x, y, z) {
return undefined;
}
});
}