Results 1 to 6 of 6

Thread: pop up window

  1. #1
    Join Date
    Sep 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default pop up window

    hi there...i need some help here...

    i have a drop down menu which retrieve a data such as "username" from the database. when user select one of the username, it will popup th new window that will carried out the username that the user select...

    how can i do that? can anybody help me..plz.

  2. #2
    Join Date
    Aug 2006
    Posts
    239
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    not really a PHP question, since the drop-down menu is client-side feature.basically you can use onchange="window.open()" feature in select

  3. #3
    Join Date
    Sep 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by ItsMeOnly
    not really a PHP question, since the drop-down menu is client-side feature.basically you can use onchange="window.open()" feature in select
    i've used the onchange="window.open()" function...it success pop up a ew window..but unfortunately, the page didn't carried out the username..so..how can i carried out the username for the new window page??

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    This is a specific question about your particular system. How are the usernames stored?

    Here's what I'd do...

    window.open('http://yourdomain.com/page.php?user='+this.value)

    Hopefully, that'll become....
    ?user=djr33, if you chose my screenname from the list.

    Then in the page that opens....

    <?php echo $_GET['user']; ?>

    That outputs the username.

    Instead of using echo, use another function to get the info from the database. I can't give you that code because I have no idea how your system works.
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    If you are already using javascript to open the window, any variable on the page that opened the window is available on the page in the opened window, as long as the opener is still open. For example, if username on the opener is bob:

    var username='bob';

    You can get that value on the opened page:

    alert(opener.username);

    Will, in this case pop up an alert saying:

    bob
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Sep 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    tq guyz..for the suggestion...i've solved my problem...tq again...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •