izzy Posted July 17, 2006 Share Posted July 17, 2006 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> Link to comment https://forums.phpfreaks.com/topic/14826-open-a-link-in-a-new-window/ Share on other sites More sharing options...
wildteen88 Posted July 17, 2006 Share Posted July 17, 2006 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 Link to comment https://forums.phpfreaks.com/topic/14826-open-a-link-in-a-new-window/#findComment-59248 Share on other sites More sharing options...
izzy Posted July 17, 2006 Author Share Posted July 17, 2006 Thanks a lot!!!Greetings,Izzy Link to comment https://forums.phpfreaks.com/topic/14826-open-a-link-in-a-new-window/#findComment-59254 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.