| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Feb 2005
Posts: 578
![]() ![]() ![]() | 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:
__________________ Freebies and Giveaways - Printable Coupons - Hot Deals - Coupons - Deal of the Day |
| | |
| | #2 (permalink) |
| Traveller Join Date: Mar 2007 Location: Yet another city
Posts: 1,419
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | echo "<li><a href='".$row['link']."' target='_blank'>".$row['title']."</a></li>";
__________________ NameCooler.com |
| | |
| | THREAD STARTER #3 (permalink) |
| NamePros Regular Join Date: Feb 2005
Posts: 578
![]() ![]() ![]() | Thanks, rep added.
__________________ Freebies and Giveaways - Printable Coupons - Hot Deals - Coupons - Deal of the Day |
| | |
| | #4 (permalink) |
| NamePros Member Join Date: Nov 2009 Location: Christchurch, New Zealand
Posts: 27
![]() | 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) |
| | |
| | #5 (permalink) |
| NamePros Regular Join Date: Jul 2007 Location: UK
Posts: 394
![]() ![]() ![]() ![]() ![]() ![]() ![]() | 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:
__________________ |
| | |