Page 1 of 1

[solved] opening a popup window and passing data to it

Posted: Wed Dec 14, 2005 4:55 pm
by robster
Hi all,

I've been trying to have a link that when clicked, opens a window with var $id sent with it. Obviously then i can use $id on the popup end to pull what I want from the database but I just can't seem to get it to work.

Am I missing something really simple? Is there a trick to this or is it a straight up GET or POST url with target = NEW?

Thanks a tonne :)


Rob

Posted: Wed Dec 14, 2005 4:58 pm
by Burrito

Code: Select all

<script>
var newwin = window.open('somepage.php?id=<?=$id;?>','nwin','width=400,height=400');
newwin.focus();
</script>

Posted: Wed Dec 14, 2005 7:32 pm
by robster
is that javascript then?

I presume I create a function and put that code in it?

Thanks again :)

rob

Posted: Wed Dec 14, 2005 7:54 pm
by robster
cancel that, i did make it a function and it works perfectly.

Thanks again, so much :)

ROB!!!