Jump to content


Photo

open a link in a new window


  • Please log in to reply
2 replies to this topic

#1 izzy

izzy
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 17 July 2006 - 10:38 AM

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>



#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 17 July 2006 - 10:44 AM

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


#3 izzy

izzy
  • Members
  • PipPipPip
  • Advanced Member
  • 31 posts

Posted 17 July 2006 - 11:02 AM

Thanks a lot!!!

Greetings,
Izzy




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users