
November 14th, 2001, 08:08 PM
|
|
Member
|
|
Join Date: Jul 2001
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Javascript pop-ups within PHP
Hi, I am trying to have a pop-up box using javascript for the more info button in my shopping cart but I cannot seem to get the javascript to work within the php.
Can anyone let me know why this isn't working. the code is below...
php part:
PHP Code:
while ($r = mysql_fetch_array($result)) { // Begin while
extract($r);
echo "
while ($r = mysql_fetch_array($result)) { // Begin while
extract($r);
echo "
<tr>
<td><font>$category</font></td>
<td><font>$productname</font></td>
<td><font>$ $price</font></td>
<td><a href='javascript:popUp('products2.php?key='$id')'>More Info</a></td>
<td><form action=cart.php method=get>
<input type=hidden name=item value=$id>
<font>Quantity:</font><input type=text name=qty value=1 size=3>
<input type=submit value=ADD>
</form></td>
</tr>
";
} // end while
echo "</table>";
and this is the javascript that it is calling:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=250,height=200,left = 412,top = 284');");
}
// End -->
</script>
**
ignore this : <img src="images/smilies/tongue.gif" border="0" alt="">
it is supposed to be
Thanks
Last edited by qipix : November 14th, 2001 at 08:10 PM.
|