Results 1 to 2 of 2

Thread: Opening Multiple Link in multiple Window

  1. #1
    Join Date
    May 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Opening Multiple Link in multiple Window

    I m trying to prepare an application, which accepts Visitors interests in Check-boxes and open different links in new windows. But, the problem is I can’t able to open those links in different new windows at a time, its opening only first link within the same window, but I want to open all links in different windows. Following is my code :-

    Code:
    <?php
    $e=$_POST['from'];
    $u=implode(', ',$_POST['unit']);
    $un = explode(", ", $u);
    $i=0;
    
    for ( $counter = 0; $counter <= 4; $counter += 1) {
    if ($un[$counter] != "") {
    $i=$i+1;
    echo $un[$counter]."<br>"; 
    echo $e."<br>"; 
    ?>
    <script language="javascript">
    window.location.href="http://www.mercatornet.com?unit=<?php echo $un[$counter];?>&from=<?php echo $e;?>";
    </script>
    <?php
    }
    }
    ?>

  2. #2
    Join Date
    Mar 2010
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Im not so good with Js but im gonna make a try, i already have the same problem and i make this poor function:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Documento sin t&iacute;tulo</title>
    </head>

    <body><a href="javascript:multipopup(['bla.htm','bla2.htm','bla3.htm'])">Click me plz</a>
    <script language="javascript">
    <!--//
    function multipopup(where) {
    var total = where.length;
    alert(total); // How much Windows Sir?
    x=0;
    for(x=0;x<total;x++){
    var mypopups = window.open('"'+where[x]+'"', "page"+x, "width=400, height=400, status=no, scrollbars=no, toolbars=no, menubar=no");
    }
    }
    //-->
    </script>
    </body>
    </html>
    I hope it helps in the meantime.

    Cheers.
    Last edited by vinnie; 03-29-2010 at 01:30 AM. Reason: An idea maybe later ill make better

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •