nightkarnation Posted September 10, 2008 Share Posted September 10, 2008 This is correct: Print "<a href=".$result['url'] . ">" .$result['description'] . "</a><br>"; Now i want to do the same but target _blank: Print "<a href=".$result['url'] . "target="_blank">" .$result['description'] . "</a><br>"; INCORRECT...what am i doing wrong ?? Thanx in advance for the help! Cheers, Link to comment https://forums.phpfreaks.com/topic/123554-easy-and-simple-a-href-question/ Share on other sites More sharing options...
nightkarnation Posted September 10, 2008 Author Share Posted September 10, 2008 Solved !! Correct code: <a href="<?php echo $result['url']; ?> "target="_blank"> <?php echo $result['description']; ?> </a><br> Link to comment https://forums.phpfreaks.com/topic/123554-easy-and-simple-a-href-question/#findComment-638129 Share on other sites More sharing options...
JasonLewis Posted September 10, 2008 Share Posted September 10, 2008 If you want to do it all in PHP, you need to escape your quotes. print "<a href=\"".$result['url'] . "\" target=\"_blank\">" .$result['description'] . "</a><br>"; Link to comment https://forums.phpfreaks.com/topic/123554-easy-and-simple-a-href-question/#findComment-638145 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.