#1
  1. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Posts
    3
    Rep 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 09:10 PM.
  2. #2
  3. Mobbing Gangster
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Sep 2001
    Location
    "Best City" 2002 and 2003- Melbourne, Australia
    Posts
    4,912
    Rep Power
    33
    your echo's are messed up, and also it might be a good idea to specify what 'problem' you're having.
    And you know I mean that.
  4. #3
  5. No Profile Picture
    Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2001
    Posts
    3
    Rep Power
    0
    the problem is that the javascript is not working at all but it will work when done in standard php, the echos stuffed up when I put them in cause of the smiles you can have, there was supposed to be a : next to a p but this makes a smiley face...
    any ideas how to do it?

IMN logo majestic logo threadwatch logo seochat tools logo