Nasıl metin kullanıcı-biçimlendirme bir HTML formunda girilen ve bir MySQL veritabanında saklanan korumak?

0 Cevap php

I have a website in which a user enters text into an html form. The nature of the content is such that it is likely the user will want to write multiple paragraphs. As it stands now, the form sends the text via POST to a PHP file which inserts the text into a database. On another page, the text is pulled from the database and displayed. When it is displayed, all user formatting is gone. Multiple spaces and line breaks are deleted. How can I save the formatting of the user? Instructing him to use HTML tags to format is not feasible for a couple of reasons. I have also considered the <pre> tag, but that creates layout-breaking long lines of text and changes the font.

Herhangi bir yardım çok takdir.

0 Cevap