Log in

View Full Version : pop up window



syazyan
09-19-2006, 07:37 AM
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.

ItsMeOnly
09-19-2006, 11:32 AM
not really a PHP question, since the drop-down menu is client-side feature.basically you can use onchange="window.open()" feature in select

syazyan
09-20-2006, 03:10 AM
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??:confused: :(

djr33
09-20-2006, 05:12 AM
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.

jscheuer1
09-20-2006, 06:12 AM
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

syazyan
09-20-2006, 06:49 AM
tq guyz..for the suggestion...i've solved my problem...tq again...