How to open multiple browser windows on request? (PHP)
So I have a form on PHP/HTML
page. User submitss it to that same 开发者_StackOverflowPHP/HTML
page. So now PHP page I will have $_POST
data. I want to when page is refreshed opnt some popUp browser windows which url's will be relative to users POST
request. like www.example.com/bal-bla-bla.php? id=$_POST['StreamId']
Include some <script>
elements with window.open
calls in them in the response … then watch as every popup blocker in the world blocks them.
if ( isset($_POST['submit']) ) {
echo '<script>window.open ("'.$_SERVER['PHP_SELF'].'myplayer.php?stream_id='.$_POST['StreamId'].'","myplayer");</script>';
}
edited:
you can always display a message before open the window that advice the user to accept this new window!
var flag = confirm(" This window is not an ADV! ;-) ");
if (flag)
window.open("'.$_SERVER['PHP_SELF'].'","myplayer");
You would need to do this client side in javascript.
You could use window.open() in a document.onload event handler.
However, chances are if the user has a pop-up blocker this will be blocked.
精彩评论