NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page terget_blank help

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Reply
 
LinkBack Thread Tools
Old 11-09-2009, 11:56 PM THREAD STARTER               #1 (permalink)
NamePros Regular
Join Date: Feb 2005
Posts: 578
abcde is a jewel in the roughabcde is a jewel in the roughabcde is a jewel in the rough
 



terget_blank help


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 Code:
echo "<li><a href=".$row['link'].">".$row['title']."</a></li>"
????: NamePros.com http://www.namepros.com/programming/622133-terget_blank-help.html
Thanks
abcde is offline   Reply With Quote
Old 11-10-2009, 12:03 AM   #2 (permalink)
Traveller
 
-NC-'s Avatar
Join Date: Mar 2007
Location: Yet another city
Posts: 1,419
-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future-NC- has a brilliant future
 


Animal Cruelty Animal Rescue Ethan Allen Fund Protect Our Planet
echo "<li><a href='".$row['link']."' target='_blank'>".$row['title']."</a></li>";
__________________
NameCooler.com
-NC- is offline   Reply With Quote
Old 11-10-2009, 12:05 AM THREAD STARTER               #3 (permalink)
NamePros Regular
Join Date: Feb 2005
Posts: 578
abcde is a jewel in the roughabcde is a jewel in the roughabcde is a jewel in the rough
 



Thanks, rep added.
abcde is offline   Reply With Quote
Old 11-10-2009, 01:00 AM   #4 (permalink)
NamePros Member
Join Date: Nov 2009
Location: Christchurch, New Zealand
Posts: 27
Mr Spy is an unknown quantity at this point
 




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
__________________
Caleb (Spy) Isaacs: Web Designer, Developer and soon-to-be domainer!
Game Sector Network | Mind Tyrant Creative (soon!) | Kiwi Dynamic (For sale)
Mr Spy is offline   Reply With Quote
Old 11-10-2009, 06:13 AM   #5 (permalink)
NamePros Regular
 
qbert220's Avatar
Join Date: Jul 2007
Location: UK
Posts: 394
qbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to beholdqbert220 is a splendid one to behold
 


Protect Our Planet
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 Code:
echo "<li><a href=\"".$row['link']."\" target=\"_blank\">".$row['title']."</a></li>"
????: NamePros.com http://www.namepros.com/showthread.php?t=622133
qbert220 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:33 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger