Jump to content

Archived

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

hanhao

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

[code]<script>

function popup( link , pop )
{
  window.open( pop ,null,
    "height=200,width=400,status=yes,toolbar=no,menubar=no,location=no");
    
    document.location = link;
}
</script>

<body>

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

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.