Target="_blank" for the php link

Hello friends

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.

"<li><a href=\“\\”>SOA</a></li>

Thanks in advance.:slight_smile:

HTML anchor element basics

echo "<li><a href=\\"\\" 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>
Off Topic:

Oops, too slow :smiley:

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…

  1. HTML
  2. CSS
  3. PHP
  4. MySQL
  5. JavaScript

Sort of on topic, but not PHP :slight_smile: … 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

It was deprecated years ago. here is a discussion from 2004:
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. :slight_smile:

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. :wink:

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.