Jump to content

Contained HTML


Mazar
 Share

Recommended Posts

Quick question, If I were to allow users to post content that could include html, and stored that data in a MySql database, then I would print it on the page eventually, is there a way I can contain their html inside a div so that it cannot affect any code outside of that div? Thanks,Andrew

Link to comment
Share on other sites

Thanks, but I think you misinterpreted what I meant lol I want the html entities to work, but only within, say, a specified div. That is to say, if this were the code:<div class="user_input_sample"> <!-- user input start here --></div> this would mess with the outter html<b> ohai </b> <!-- this line should work (i.e. make it bold) --><!-- user input end here --> </div> So, what I want is so that it would allow users to use html to format their text (not ubbc), but a way to prevent it from affecting the html outside that specified div. The links you provided seemed to be more of a replace special chars thing.

Link to comment
Share on other sites

Guest So Called

I think you'll have to parse your user HTML code. I dunno. Maybe an IFRAME might do it. The egg-spurts will have to chime in. :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...