Jump to content


This topic is now archived and is closed to further replies.


dynamically creating a image that links to 2 other URLs

Recommended Posts

hi, i need to dymaically create a thumbnail button that when the user clicks on it, it does 2 things

1. links to another page called (page1.php)
2. popup another page in new browser called (page2.php) but set this popup in the background

but the problem is <a href only allows 1 page to be linked
how do i do the above?

please help

Share this post

Link to post
Share on other sites
this is more of a javascript question i would think. i'm looking in to it now.

this doesn't use any PHP so you will have to work your php into it. i just want to get you the basic idea of how this could be done.

here you go


function popup( link , pop )
  window.open( pop ,null,
    document.location = link;


<img src="someimage" onclick="popup('http://www.phpfreaks.com','http://www.google.com')">

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.