hiding html tags but should reflect its effects

Hi friends
I am working on back end system developed in php…I am facing a very simple n silly problem…but m nt getting it exactly so just help me if u can…ny help is appreciable…
At backend i can modify user’s profile which will be displayd on site after my updation…now while writing the profile info i use some html tags like
and close them properly too…but problem is that after updation,on site all these tags r visible to viewers… i hope u all get my problem… code is in php…plss g sm soln.
eg.
abc
when i entered this text…viewers must see abc in bold letters but tags should not b displayed

You probably need to use stripslashes() around the profile text when you are displaying it.

what is that exactly?pls elaborate…

I’m guessing your storing the profile in a database of some sort? If so, the database adds back slashes in front of special characters. So
becomes <br>
When the text <br> is displayed on a website, it shows the characters following the slashes, so

What stripslashes does is it removes those backslashes so the html interprets those characters as a tag, instead of something you want directly output.

[php]$profile = “profile text”;
echo stripslashes($profile);[/php]
Should fix your problem.

still showing the same results…no change… :frowning:

Check that when you update the data in the DB or when it is retrieved the script doesn’t use htmlspecialchars.

Sponsor our Newsletter | Privacy Policy | Terms of Service