Modernvox Posted January 20, 2010 Share Posted January 20, 2010 Hi Guyz, Where do I insert this target=”_blank”? echo "<a href=\"$url{$post[1]}\">{$post[2]}<font size=\"3\">{$post[3]}</font></a><br />"; print "<BR />\n"; Seems no matter where i try to place it it displays with the results? Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/189112-where-do-i-insert-this-tag/ Share on other sites More sharing options...
premiso Posted January 20, 2010 Share Posted January 20, 2010 echo "<a href=\"$url{$post[1]}\" target=\"_blank\">{$post[2]}<font size=\"3\">{$post[3]}</font></a><br />"; What was most likely happening is that the target you posted is using Smart Quotes and not straight, those do not get parsed correctly and tend to cause errors. Link to comment https://forums.phpfreaks.com/topic/189112-where-do-i-insert-this-tag/#findComment-998401 Share on other sites More sharing options...
Modernvox Posted January 20, 2010 Author Share Posted January 20, 2010 echo "<a href=\"$url{$post[1]}\" target=\"_blank\">{$post[2]}<font size=\"3\">{$post[3]}</font></a><br />"; What was most likely happening is that the target you posted is using Smart Quotes and not straight, those do not get parsed correctly and tend to cause errors. Thanks Presimo that worked, but what is the reason for the / ? Link to comment https://forums.phpfreaks.com/topic/189112-where-do-i-insert-this-tag/#findComment-998413 Share on other sites More sharing options...
co.ador Posted January 20, 2010 Share Posted January 20, 2010 its a way of parsing the double quotes! Link to comment https://forums.phpfreaks.com/topic/189112-where-do-i-insert-this-tag/#findComment-998416 Share on other sites More sharing options...
Modernvox Posted January 20, 2010 Author Share Posted January 20, 2010 its a way of parsing the double quotes! ok..thanks co.ador Link to comment https://forums.phpfreaks.com/topic/189112-where-do-i-insert-this-tag/#findComment-998420 Share on other sites More sharing options...
premiso Posted January 20, 2010 Share Posted January 20, 2010 its a way of parsing the double quotes! To put that statement in more correct terms, it escapes the double quote since you are in double quotes as if you do not there will most likely be a syntax error. Alternatively you could do this: echo '<a href="' . $url . $post[1] . '" target="_blank">' . $post[2] . '<font size="3">' . $post[3] . '</font></a><br />'; And not have to escape any quotes. But either way works fine. Link to comment https://forums.phpfreaks.com/topic/189112-where-do-i-insert-this-tag/#findComment-998434 Share on other sites More sharing options...
Modernvox Posted January 20, 2010 Author Share Posted January 20, 2010 its a way of parsing the double quotes! To put that statement in more correct terms, it escapes the double quote since you are in double quotes as if you do not there will most likely be a syntax error. Alternatively you could do this: echo '<a href="' . $url . $post[1] . '" target="_blank">' . $post[2] . '<font size="3">' . $post[3] . '</font></a><br />'; And not have to escape any quotes. But either way works fine. Yeah, this way looks alot more organized. Thanks again, Presimo Link to comment https://forums.phpfreaks.com/topic/189112-where-do-i-insert-this-tag/#findComment-998488 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.