Preserve and display text exactly how it is typed and submitted

后端 未结 2 446
栀梦
栀梦 2020-12-04 04:15

I\'m having lots of trouble preserving the exact look of how a user types out a short paragraph.

My problem is that random slashes and html show up

2条回答
  •  清歌不尽
    2020-12-04 04:50

    On the second step you need to escape it with mysql function.

    But for correct outputing it you need to do following

    This will get from database result needed information and will outputs it like it is. With all spaces and tabs and html tags in it. (If user enters this will output like text)

提交回复
热议问题