This question already has an answer here:
I use a header location to link another site at my site. Please, don't look after this manner, I can't do anything with it... My code looks like this
if($navigateId==82) {
header( "HTTP/1.1 301 Moved Permanently" );
header( "Location: http://newsite.com/sample-link" );
}
I would like, if I only can open this anchor at new card (target="_blank") Thanks for help
</div>
The thing is that you are using server-side redirection and the target="_blank" is client-side directive to browser to open the URL in new window (or tab). So I don't think that you can arrange it using server-side coding.
BTW, I have found already this question answered - Header Location in new tab
You can arrange needed functionality using jquery. I mean if the link which needs to be checked and opened in new window is not static html content or entered in a WYSIWYG you can check by AJAX call the id server-side and open it in new window if needed. The checkings can be done also client side but you have to supply the javascript code with the ID-s which need to be opened in new window.
No it's not possible. header will simply redirect the current page, in the current window.
For this you need to use js like:-
<script type="text/javascript">window.open('http://www.example.com');</script>
For more :- Header Location in new tab