Jump to content

Archived

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

izzy

open a link in a new window

Recommended Posts

Hi,

I've got a script that opens a url that is placed in my database.
The only thing is that it opens in the same window as my site. It replaces my site.

How can i make the page open in a new window?

here is the script...

<table width="300" border="0">
<tr>
  <td class="lightheader">
    <span><?php echo "<a href=\"".$link['url']."\">"?><strong><?php echo $link['name']?></a></strong></span>
  </td>
</tr>
<tr>
  <td class="footer">
    <span><?php echo $link['description']?></span>
  </td>
</tr>
      </table>
    <td width="200">   
      <span><?php echo "<a href=\"".$link['url']."\">"?><strong><?php echo $img?></span>
  </td>
</table>

Share this post


Link to post
Share on other sites
Add the target attribute to the the anchor tag eg:
[code]<?php echo "<a href=\"".$link['url']."\" target=\"_blank\">" ?><strong><?php echo $link['name']?></a>[/code]
Now when the you click the it'll open a new window/tab

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.