PHP AJAX 12017 Error when calling Header(Location:) [duplicate] PHP AJAX 12017 Error when calling Header(Location:) [duplicate] ajax ajax

PHP AJAX 12017 Error when calling Header(Location:) [duplicate]


I believe if you are using ajax request, you have to handle redirects within javascript (where the request is made).

If your php script sets the Location header of the response when you make an ajax request, it will try to redirect the ajax request not the page that is displayed in the browser.

You can try to handle the error where you make the request (I would have been more specific if I saw the code making the request).

You can try changing your script so that it returns some kind of status code and then handle this status with js/jquery and make the redirect there:

document.location=' *new url to redirect the browser to* '