Page 1 of 1

Automatically open new window whilst passing variables

Posted: Tue Feb 10, 2009 4:29 am
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

Re: Automatically open new window whilst passing variables

Posted: Wed Feb 11, 2009 1:51 pm
by kaszu
You need to use javascript.
Google

Re: Automatically open new window whilst passing variables

Posted: Wed Feb 11, 2009 3:04 pm
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.