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. Quote 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. Quote 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 / ? Quote 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! Quote 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 Quote 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. Quote 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 Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.