最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to open multiple browser windows on request? (PHP) - Stack Overflow

programmeradmin3浏览0评论

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/bal-bla-bla.php? id=$_POST['StreamId']

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./bal-bla-bla.php? id=$_POST['StreamId']

Share Improve this question edited Feb 9, 2014 at 8:06 Suhaib Janjua 3,57216 gold badges69 silver badges87 bronze badges asked Apr 28, 2010 at 12:24 RellaRella 67.1k112 gold badges374 silver badges642 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 6

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.

发布评论

评论列表(0)

  1. 暂无评论