PDA

View Full Version : Opening Multiple Link in multiple Window



deb_cal2
03-26-2010, 02:30 PM
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 :-


<?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
}
}
?>

vinnie
03-29-2010, 12:43 AM
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.