Jump to content


Photo

displaying part of body as an acronym on a link, problems


  • Please log in to reply
1 reply to this topic

#1 echoninja

echoninja
  • Members
  • PipPip
  • Member
  • 16 posts

Posted 13 April 2006 - 02:15 AM

Ok at the moment I have a list of entries for articles, I want a quick preview when the person hovers over the link, this is the code I have at the moment

$str=$a["body"];
              $newlength="60";              
              $a_body=substr($str, 0, $newlength);
              echo "&nbsp; ● <acronym title=". $a_body ."><a href=showarticle.php?id=". $id .">". $a_title ."</a></acronym> [posted ". $a_date ."]";

It works to an extent, it only displays the first word, what am I forgetting?

#2 arifsor

arifsor
  • Members
  • PipPipPip
  • Advanced Member
  • 50 posts
  • LocationPakistan

Posted 13 April 2006 - 06:02 AM

forgot to put the \ before and after "
try this

 echo "&nbsp; ● <acronym title=\"". $a_body ."\"><a href=showarticle.php?id=". $id .">". $a_title ."</a></acronym> [posted ". $a_date ."]";?>

---------------------------
Power Demand Respect
Arif Sorathia




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users