Hello, I have following code:
function addUser(value){
var adduser = value;
var useremail = localStorage.getItem('email');
var userpassword = localStorage.getItem('password');
var acao = "adicionar";
$.post('http://localhost/app/searchplayer.php', {useremail : useremail, userpassword : userpassword, acao : acao, adduser : adduser}, function(retorna){
if(retorna == "sucesso2"){
alert (retorna);
}
});
}
and the php code I have a single echo that returns success2 (echo "success2";) however in the if statement of the script it does not return the alert. If I just put alert (returns); it returns the alert with the success2 value but with the if statement it does not return. Any idea what that might be?