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

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
robster
Forum Contributor
Posts: 360
Joined: Wed Jul 16, 2003 8:28 am
Location: Sunshine Coast, Australia

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

Post 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
Last edited by robster on Wed Dec 14, 2005 7:54 pm, edited 1 time in total.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

Code: Select all

<script>
var newwin = window.open('somepage.php?id=<?=$id;?>','nwin','width=400,height=400');
newwin.focus();
</script>
User avatar
robster
Forum Contributor
Posts: 360
Joined: Wed Jul 16, 2003 8:28 am
Location: Sunshine Coast, Australia

Post by robster »

is that javascript then?

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

Thanks again :)

rob
User avatar
robster
Forum Contributor
Posts: 360
Joined: Wed Jul 16, 2003 8:28 am
Location: Sunshine Coast, Australia

Post by robster »

cancel that, i did make it a function and it works perfectly.

Thanks again, so much :)

ROB!!!
Post Reply