views:

16

answers:

1

Hi,

I am looking for Free PHP script to open multiple URLs at once click. Please let me know if anyone find anywhere.

Thanks in advance, Manim

A: 

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');"&gt;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>";
NullUserException
I will create a page on my site and test your code. I update the status shortly. Thanks for your help! Manim
Manim
Dear NullUserException - Thanks for your script. Actually I am looking for a php script to my website page. Please refer the link: http://golink-directory.com/seo/openurl.php --- something like this.
Manim