I want two of my links to open as target="blank" but I am not sure where to give target="blank" for the below link. Could you please help me fix this. Below is the link that I am trying to give target="_blank" so that it opens in a new window.
Thanks in advance.:)
HTML anchor element basics http://www.w3schools.com/tags/att_a_target.asp
echo "<li><a href=\\"http://ebiz.bpc.co.in/soa\\" target=\\"_blank\\">SOA</a></li>\
There are no "php links". Links are html.
Just put the target part inside the <a> tag:
<a href=\\"http://...\\" target=\\"_blank\\">link</a>
Oops, too slow
Thanks a lot SgtLegend and guido2004.
I just pasted the code and it works perfectly.
I am new to php. Thanks to both of you again.
No problem, i recommend you learn HTML before you continue with PHP as you will continue to find it difficult to understand. This is how i learn't...
Sort of on topic, but not PHP ... isn't the target="_blank" attribute now deprecated in the HTML specification? Yes, I know it still works - I sometimes use it myself - but will there come a time when the browsers stop supporting it?
The W3C standards doesn't say its deprecated http://www.w3.org/TR/2003/WD-WCAG20-HTML-TECHS-20031209/#links_popup
It was deprecated years ago. here is a discussion from 2004: http://www.sitepoint.com/forums/showthread.php?threadid=198185
and there are currently a couple of (heated) discussions about it!
I think in today's tabbed-browser world then a lot of the comments raised there about new windows are now moot.
But the JS alternatives to _blank are unreliable as it is a lot easier these days for people to block JS from running (either en masse or selectively). So like I said earlier, _blank may be deprecated but I do still use it sometimes.
In 1997 it was decided that it iis far more user friendly to allow your visitors to decide how they want pages to open. By getting rid of the target attribute when they designed HTML4 they ensured that those pages that follow the standards do not disable any of the alternatives when you right click on the link to select where to open it. With a target the page maps the "open" and "open in a new window" options to the same thing.
When this was discussed in 2004 the target attribute had already been dead for 7 years. When you use target you are writing HTML3.2 (or earlier) and making your pages harder for your visitors to use.
Thank you SgtLegend and to all of you. I will start learning in order SgtLegend mentioned.
Again thanks to you all for spending time to resolve my question.