Automatically open new window whilst passing variables

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
PZAnders
Forum Newbie
Posts: 4
Joined: Wed Feb 04, 2009 7:40 am

Automatically open new window whilst passing variables

Post by PZAnders »

Hello,

I am scratching my head to find a solution in PHP where by I can open a new browser in a foreach loop for each instance whilst passing variables. This needs to happen automatically, no input by the user so something like this:
foreach ($array as $data)
{
echo "<a href='./code.php?data=$data'>link</a>";
}
wouldnt work as it requires a click!

Is there anything in PHP that can get around this, or do I have to use javascript??
Many thanks in advance
User avatar
kaszu
Forum Regular
Posts: 749
Joined: Wed Jul 19, 2006 7:29 am

Re: Automatically open new window whilst passing variables

Post by kaszu »

You need to use javascript.
Google
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Automatically open new window whilst passing variables

Post by John Cartwright »

Any modern browser will automatically block any automated popup. To successfully open a popup window, you generally need to bind it a user triggered event, such as a click.
Post Reply