Jump to content

dynamically creating a image that links to 2 other URLs


hanhao

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
Link to comment
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]
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.