I have to open multiple pages when hit a button. For example a user hits a button, and I have to open 5-6 new sites at different pages with specific urls. Is it possible with php or not?
I doubt it, it'd probably be with javascript and window.open (5 times). I haven't tried it though, but there could be a minuscule chance browsers have some sort of anti-window-spamming sort of thing in place to prevent it.
I think this should work. <?php $windows = array('www.google.com','www.yahoo.com','www.msn.com'); foreach($windows as $key => $value) { $open .= "window.open('http://$value','window$key');"; } ?> <a href="javascript:<?=$open?>" >Click Here</a> PHP:
Thanks a lot! It works really good but just one problem. After opening these page, my main page goes to something like that: javascript:window.open('http://www.google.com','window0');window.open('http://www.yahoo.com','window1');window.open('http://www.msn.com','window2'); I wanna my page does not change. Is it possible?