You need to handle this on the client’s browser, not the server.
Assuming that you’re posting a form, you could send the original request over ajax, capture the result and open a new window pointing at the relevant URL.
What is the purpose of the new window / tab exactly?