PHP header redirection in new window?

For banner management system I use

 header("Location: http://www.awebsite.com");

to redirect to the appropriate website. Can I make this script header open in a new window?

+3
source share
5 answers
<a href='yourbannerscript.php' target='_blank'>...</a>
+6
source

No. If you want to create a new window, you need to send the redirect in the form of HTML / Javascript.

+3
source

echo "<script>window.open('yoursite.com');</script>";
+3

, , , , IFRAME, php , . , .

<iframe src="/myredirectscript.php"></iframe>
0

, , Open Open

, , , :

<meta http-equiv="refresh" />
<meta content="0; URL=javascript:window.open('http://uri.of
.your.pagewhereyouwabtoredirect/path','_parent');"/>
0

Source: https://habr.com/ru/post/1709765/


All Articles