hi all..need ur help...i've a page displayin title and full topic text from mysql..
actually i want to show the topic title in the url linked to full text topic..
the code of title and full topic text look like:
printf('<div id=lsm><a href="topic.php?topicid=%s&title=%s">%s</a></div>',$myrow["topicid"], myrow["title"], myrow["topic"]);
this code is working fine.. there were spaces in the url linked to topic..
i used this code for spaces:
$myrow['title'] = str_replace(' ', '-', $myrow['title']);
i placed it above the printf its working fine..
now coming to the problem..
there's some pages wich display only the title as text and is linked to the topic..i placed the code.. so it also replacing the spaces with hypens in title as text..i url is perfect but i just want it to replace the spaces in title link not in any other location..where title is displayed as a text not as a link..
and placing the str_replace code above every line sounds wierd..just increasin document size..
there's alot of title in the page and i cant paste this code above all queries..
so how can i do this just to the link url and not to titles in html table headin etc?
So guys please help me with this.