help with popup function [SOLVED]

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
dakkonz
Forum Commoner
Posts: 69
Joined: Sat Dec 27, 2003 2:55 am
Location: Asia

help with popup function [SOLVED]

Post 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??
Last edited by dakkonz on Sat May 22, 2004 3:08 am, edited 2 times in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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>";
}

?>
dakkonz
Forum Commoner
Posts: 69
Joined: Sat Dec 27, 2003 2:55 am
Location: Asia

Post by dakkonz »

yah it worked....thanks a lot
Post Reply