Hello i want to redirect to an url with a parameter recived from ajax response. Here is my script:
<script>
$(function() {
$("button#submit").click(function(){
$.ajax({
type: "POST",
url: "engine/app/insert_user.php",
data: $(\'form#inregistrare\').serialize(),
success: function(data){
if (data == "succes") {
window.location=\'profil.php?user=data\';
}
else {
alert("You have something wrong in your form.");
}
},
error: function(){
alert("failure");
}
});
});
});
</script>