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

    Join Date
    Feb 2003
    Rep Power

    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.

    put this into your head tags:

    <script language="JavaScript">
    function MM_openBrWindow(theURL,winName,features) { //v2.0

    in your body tags put this:

    $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'>
    <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 "

    create popup.php

    between the body tags put this:

    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