0

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>
user3058067
  • 307
  • 6
  • 18

1 Answers1

1

Nvm i managed to fix it myself

window.location=\'profil.php?user=\'+data;
user3058067
  • 307
  • 6
  • 18