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

    Join Date
    Feb 2003
    Posts
    1
    Rep Power
    0

    Lightbulb javascript popup from php/mysql


    This is a solution for people who want to have a javascript popup while php is getting data form the database. So that when you click the link it will popup.

    PAGE1
    put this into your head tags:

    <script language="JavaScript">
    <!--
    function MM_openBrWindow(theURL,winName,features) { //v2.0
    window.open(theURL,winName,features);
    }
    //-->
    </script>

    in your body tags put this:

    <?PHP
    $mail = "my@email.com";
    $name = "john doe";

    /*say that the loop got those values (above) from the database */

    print "<table width='744' height='24' border='0' cellpadding='0' cellspacing='0'>
    <tr>
    <td width='163' bgcolor='#FFFFFF'>"
    ?><a href="javascript:;" onClick="MM_openBrWindow('popup.php?mail=<?PHP print $mail; ?>','','width=450,height=400')"><?PHP print $name; ?></a></td>
    <?PHP print "
    </tr>
    </table>"
    ;
    ?>


    PAGE2
    create popup.php

    between the body tags put this:

    <?PHP
    print $mail;
    ?>

    this is what is going to popup in your window

    You can use this script when you get some names from the database and you want to make the names clickable...and when do so it will create a pop up.

    Hope this helps!
    Regards John Amir
    Last edited by sardo187; February 13th, 2003 at 07:38 PM.

IMN logo majestic logo threadwatch logo seochat tools logo