I've created a form that will be submitted via JQuery, specifically: link .
Well, I submit the form, the php file is recognized, it returns the error messages and everything, the problem is that it does not recognize the data received via POST. Here are the codes:
JQuery:
function editProfile(){
$("#edit-profile").ajaxSubmit({
url: "/ajax/edit_user_profile.php",
success: function(result){
$("#result").html(result);
if(result['error'] == false){
$("#result").html("Salvo com sucesso!");
}
else{
$("#result").html(result['msg_error']);
}
},
beforeSend: function(result){
if(result['error'] == true){
$("#result").html(result['msg_error']);
}
},
error: function(e){
$("#result").html("Error!");
},
type: "POST"
});
}
Form summary (HTML):
<form id="edit-profile" method="POST">
<!--Nome e sobrenome-->
<label class="form">
<b>Nome</b>
<input type="text" class="input text" placeholder="Nome..." name="name" maxlength="255" value="<?php echo $user['name'] ?>" required>
</label>
...
I put isset($_POST)
and it recognizes, but isset($_POST['name'])
, for example, it does not recognize.
Does anyone know what might be wrong? I've made two forms with a structure almost identical to this one recently, and it was first ...