Redirect with PHP after ajax call

Redirect with PHP after ajax call

$('#button_name').click(function() {
 var save_sale = 1;
 $.ajax({
 type: 'GET',
 url: 'page.php',
 data: {save_sale: save_sale},
 success: function(data) { 
       window.location.href = 'addcust.php?new_sale=' + data
 },
 error: function(xhr, ajaxOptions, thrownerror) { }
 });
});

1 thought on “Redirect with PHP after ajax call”

Leave a Reply

Your email address will not be published. Required fields are marked *