Dynadot Aftermarket: discover domain gems worth investing in. Visit our aftermarket.

Terget_blank help

SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
Watch

abcde

Established Member
Impact
16
Hi guys,

How do I add target"_blank" to this link so that when people click on it... it will open in a new window.

PHP:
echo "<li><a href=".$row['link'].">".$row['title']."</a></li>";

Thanks
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
echo "<li><a href='".$row['link']."' target='_blank'>".$row['title']."</a></li>";
 
1
Close
Thanks, rep added.
 
0
Close
I'm being anal I know...but to keep continuity and to lessen the chances of making typos a good tip is to always keep your quotes the same. So if you use single quotes for php strings, use double quotes for html elements and keep it the same all the way through. You've mixed it up here with the a href.

No biggy, but i've found it's something that's saved my ass so many times before :p
 
0
Close
To adhere to the HTML spec, you should use double quotes, not single quotes round the href URI and frame-target. Single quotes are not legal here:

PHP:
echo "<li><a href=\"".$row['link']."\" target=\"_blank\">".$row['title']."</a></li>";
 
0
Close
DomainEasy: white label portfolios are live. Enable yours.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

New: watch any domain
You can now watch domains on NamePros. We check each one and notify you when something changes. Search for a domain and press Watch on...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back