I am making the auth system of my website and I want to add password recovery option but I have a problem:
/* Handling login functionality */
function submitForm() {
var data = $("#reset-form").serialize();
$.ajax({
type : 'POST',
url : 'auth_logic/password-process.php',
data : data,
beforeSend: function(){
$("#error").fadeIn();
$("#card-body").LoadingOverlay("show", {
background : "rgba(168, 177, 187, 0.4)"
});
$("#card-body").LoadingOverlay("show");
//setTimeout('$("#card-body").LoadingOverlay("hide", true);',5000);
//$("#login").html('<img src="images/loading.gif" width="31px" height="31px" /> Моля изчакайте ...');
},
success : function(response){
if(response=="Успешно променихте паролата!"){
$("#card-body").LoadingOverlay("hide", true);
$("#error").html('<div class="alert alert-success" role="alert"> <span class="glyphicon glyphicon-info-sign"></span> '+response+'</div>');
} else if (response=="Изтекала валидност на линк!") {
$("#card-body").LoadingOverlay("hide", true);
$("#error").html('<div class="alert alert-danger" role="alert"> <span class="glyphicon glyphicon-info-sign"></span> '+response+'</div>');
} else if (response=="Грешни данни за вход!") {
$("#card-body").LoadingOverlay("hide", true);
$("#error").html('<div class="alert alert-danger" role="alert"> <span class="glyphicon glyphicon-info-sign"></span> '+response+'</div>');
} else if (response=="Невалидна заявка!") {
$("#card-body").LoadingOverlay("hide", true);
$("#error").html('<div class="alert alert-danger" role="alert"> <span class="glyphicon glyphicon-info-sign"></span> '+response+'</div>');
}
}
});
return false;
}
This is the JS Ajax i use to change the password without refresh of the page but since the url parameters (token and email) are not on the same url as the php file this doesn't work. How can I submit both form data (like POST) and the url parameters (GET) to the PHP file?
I tried to put the url parameters in hidden fileds but it also doesn't work and I can't find the mistake:
Here is the PHP code I use: https://pastebin.com/dqEh24hK