开发者

Free script to open multiple URLs at once

I am looking for Free PHP sc开发者_如何学编程ript to open multiple URLs at once click. Please let me know if anyone find anywhere.

Thanks in advance.


You probably want to affect a client's behavior, in which case you don't need PHP. Plain old HTML + Javascript will do:

<a href="#" onclick="window.open('http://www.google.com'); 
                window.open('http://yahoo.com');">Open Google and Yahoo</a>

Chances are this will be caught by popup blockers though.

To generate such code with PHP, just do:

// say your links are in an array:
$links = array('http://www.google.com', 'http://www.yahoo.com');

$open = '';
foreach ($links as $link) {
    $open .= "window.open('{$link}'); ";
}

echo "<a href=\"#\" onclick=\"{$open}\">Open multiple links</a>";


You can open unlimited url in one page by this HTML code. Try to paste the below code in a html web page.

<iframe src="http://yahoo.com" height="50%" width="49%" ></iframe>
<iframe src="http://yahoo.com" height="50%" width="49%" ></iframe>
<iframe src="http://yahoo.com/m" height="50%" width="49%" ></iframe>
<iframe src="http://yahoo.com/m" height="50%" width="49%" ></iframe>

CAUTION : google.com and some other sites may not allow to open their site url in a frame.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜