How do I open multiple browser windows on demand? (PHP)
So, I have a form on a page PHP/HTML
. The user sends it to the same page PHP/HTML
. So now in the PHP page I will have the data $_POST
. I want the page to refresh in some popUp browser windows, the url of which will be relative to the users request POST
. egwww.example.com/bal-bla-bla.php? id=$_POST['StreamId']
+2
a source to share
3 answers
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 opening a window that advises the user to accept this new window!
var flag = confirm(" This window is not an ADV! ;-) ");
if (flag)
window.open("'.$_SERVER['PHP_SELF'].'","myplayer");
+5
a source to share