1
I read some answers in the forum, but none managed to solve my problem, Ajax works in place, but when I go up it just doesn’t work, follow the code:
jQuery('#formLogin').submit(function(){
var dados = jQuery( this ).serialize();
jQuery.ajax({
type: "POST",
url: "script/logar.php",
data: dados,
success: function( data ) {
var y = data.length;
if (y == 9) {
window.location.href = "editar-perfil.php";
}
return false;
}
}
});
can pass the url of the project?
– Phelipe
http://aguamkt.com.br/perfil.business/login.php
– Alisson
Looking at the return of the request appears the following error. PHP Warning: mysqli_connect(): (HY000/2002): The requested address is not valid in context. in D: web localuser aguamkt www profile.business script bd.php on line 2 You are unable to connect to the database. Take a look at this db.php file
– Phelipe
Most likely you have not configured the connection file correctly.
– Phelipe
I also tested, and I came up with this mistake
POST http://aguamkt.com.br/perfil.business/script/logar.php 500 (Internal Server Error)
– Roberto de Campos
Really, silly mistake my, thank you very much! Solved
– Alisson
When using
ajax
you have to monitor those "silly mistakes" you say. A F12 > network help if you’re in Chrome.– user94336