Text link in PHP code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
dbldee
Forum Newbie
Posts: 5
Joined: Fri Apr 04, 2008 9:26 am

Text link in PHP code

Post by dbldee »

Hello everyone
Some very useful and interesting resources in this forum.
I could use some help with the following

Code: Select all

 
if ($config['mod_rewrite'] == 'YES') { 
                    $template_listing->set('www', '<a href="'.BASE_URL.'/out-'.$f['selector'].'.html" target=_blank class=textlink>'.$lang['listing_visit_website'].'</a>');
                } else {
                    $template_listing->set('www', '<a href="'.BASE_URL.'/listing_out.php?id='.$f['selector'].'" target=_blank  class= textlink>'.$lang['listing_visit_website'].'</a>');  
 
the class textlink is set as a clickable link
the font is adjusted with css
a.textlink{font-weight:bold;color:#FF0000;font-size:16px;}

the problem is the syntax of textlink to produce the desired font or is something else required?

I 've tried "textlink" and 'textlink' and '"textlink'" to no sucess.

Any thoughts or sugestions would be appreciated.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Text link in PHP code

Post by Christopher »

You need to escape depending on the type of quotes:

Code: Select all

'class="textlink">'
'class=\\'textlink\\'>'
"class=\"textlink\">"
"class='textlink'>"
(#10850)
Post Reply