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
Automatically open new window whilst passing variables
Moderator: General Moderators
Re: Automatically open new window whilst passing variables
You need to use javascript.
Google
- 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
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.