MY ajax code looks like this:
jQuery(document).ready(function($) {
$(".respond").submit(function(event){
..................//something here
request = $.ajax({
url: "/admin/check.php",
type: "post",
data: {formData:serializedData,submit_type:submit_name},
datetype: JSON
});
request.done(function (response, textStatus, jqXHR){
console.log(response);
});
request.fail(function (jqXHR, textStatus, errorThrown){
console.error(
"The following error occured: "+
textStatus, errorThrown
);
});
request.always(function () {
$inputs.prop("disabled", false);
});
event.preventDefault();
});
});
And when i use php code like this
var_dump($_POST["formData"]);
It gives result like this
"string(400) "user_edit=submit&user_id=1 ..........
"
I want to store userid in php variable like this
$username=......
But when i try doing like this
$username=$_POST["formData"]["userid"]
it gives error
"
Warning: Illegal string offset 'user_edit' in C:\Program Files (x86)\Ampps\www\admin\check.php on line 5
string(1) "u" "
I want to know how to i get the value of that userid or something like that.