Jump to content

how I can correct posted html to a html that is safe ?


alexmadsen

Recommended Posts

HI ,

whenever my site users posted a text(html base without strip tags) , if html post contain a closed tags and incomplete tags ; mixed my site main html .
example :
posted :

&nbsp;11111</TR><TR>
<DIV id=postbody>
<P>&nbsp;</P>
<P>2222<BR>3333 </TR><TR><IMG src="http://www.blogsky.com/editor/images/smiles/05.gif">&nbsp;<BR>44444<BR>- <IMG src="http://www.blogsky.com/editor/images/smiles/04.gif">&nbsp;<IMG src="http://www.blogsky.com/editor/images/smiles/04.gif"><BR>-55555<BR>- 666666666666666666<IMG src="http://www.blogsky.com/editor/images/smiles/20.gif">&nbs;pgsdg<BR>- 77777777777<IMG src="http://www.blogsky.com/editor/images/smiles/26.gif">&nbsp; ... sdgsdsdg <IMG src="http://www.blogsky.com/editor/images/smiles/22.gif"><BR>- 88888888888888 <IMG src="http://www.blogsky.com/editor/images/smiles/14.gif"></P></DIV>

********
corrected with gmail editor :

&nbsp;11111<table><tr>
<td><div>
<p>&nbsp;</p>
<p>2222<br>3333 </p></div></td></tr><tr><td><img>&nbsp;<br>44444<br>- <img>&nbsp;<img>
<br>-55555<br>- 666666666666666666<img>&amp;nbs;pgsdg<br>- 77777777777<img>&nbsp; ... sdgsdsdg <img>

<br>- 88888888888888 <img></td></tr></table>

</div>
************************************
how I can correct posted html to a html that is safe to my main html similar gmail? with php or javascript ?
please help me ?
Link to comment
Share on other sites

[quote author=webren link=topic=123340.msg509659#msg509659 date=1169367136]
Are you talking about making your own HTML parser?
[/quote]

I apologize that I cant speak english very well .
I want build a html that is contain my html code and users posted html .
whenever users post a text(html base without strip tags) , if html post contain a closed tags and incomplete tags ; mixed my site main html .
how I can correct posted html to a html that is safe to my main html similar gmail? with php or javascript ?
please help me ?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.