Jump to content

[SOLVED] Secure way to store HTML in the database?


pocobueno1388

Recommended Posts

Okay, to my understanding it is very unsafe to allow users to submit HTML from a form to the database.

 

What if I allowed the user to use HTML, but when they submitted it I would change all the >'s and <'s into backets [ and ].

 

So the user would type out:

<img src="image.jpg">

 

and it would be inserted into the database like this:

[img src="image.jpg"]

 

Would this be a secure way of doing it? Or is there a better way?

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.