Hello,
I want to store full HTML in database & when I am trying to store html with script tag in database its getting removed automatically. What is the best way to store HTML inside mysql using PHP? Please help me. Thanks in advance.

    Are you calling [man]strip_tags/man on the incoming data? Can you show us the code you use to store the HTML in the DB? How do you know that the HTML is getting stripped?

      Thanks for the quick reply. I am not calling any strip tag, I am storing the data using code igniter insert & here is my code,

       'pageContent'=> mysql_real_escape_string(str_replace("\n", "<br />",$data['content'])),
      
        bradgrafelman;10987790 wrote:

        How do you know that the HTML is getting stripped?

        ... is still unanswered.

        Have you checked the html source, or have you just assumed that the script elements are gone since your javascript code stopped working?

          Actually I am checking the values inserted inside database & the places where I have used script tag gets converted to [removed]

            Well, the code you've posted so far does nothing of the sort. It changes newlines into br elements.

              Write a Reply...