views:

80

answers:

3

So I have a form on PHP/HTML page. User submitss it to that same PHP/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']

+5  A: 

Include some <script> elements with window.open calls in them in the response … then watch as every popup blocker in the world blocks them.

David Dorward
+1  A: 

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.

Twelve47
+4  A: 
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");
aSeptik