Page 1 of 1

help with popup function [SOLVED]

Posted: Sat May 22, 2004 2:41 am
by dakkonz

Code: Select all

<?php
while ($row = mysql_fetch_array($result)) {						 echo "
<script>
function openlisting(){
var popurl="list.php?id={$row['listnum']}"
winpops=window.open(popurl,"","width=500,height=400,")
}

</script>"; 
		  $submit = explode('-', $row['date']);
		  echo "<tr>";
		   echo "<td><a href="javascript:openlisting()">{$row['listnum']}</a></td>";
}
?>
how come the popup function all points to the same {$row['listnum']}...i want to link the {$row['listnum']} to list.php?id={$row['listnum']} with a pop up... is there any way of doing this??

Posted: Sat May 22, 2004 2:50 am
by feyd
tried this?

Code: Select all

<?php ?>
<script language="Javascript">
function openListing(id)
{
var winpops = window.open("list.php?id="+id,"","width=500,height=400");
}
</script>

<?php

while($row = mysql_fetch_assoc($result))
{
echo "<tr><td><a href="javascript:openListing('$row[listnum]')">$row[listnum]</a></td></tr>";
}

?>

Posted: Sat May 22, 2004 3:08 am
by dakkonz
yah it worked....thanks a lot