PHP eval issue with PHP + HTML code

后端 未结 5 1029
天涯浪人
天涯浪人 2020-12-21 14:04

I\'ve got PHP and HTML code stored in a database table. When I get this data, I need to echo the HTML and process the PHP. I thought I could use eval() for this

5条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-21 14:28

    Best advice - never store php and html code in your database. And avoid eval() like the plague.

    I can't really tell what's wrong with your code, as you haven't provided enough information. But even if I did have some advice, I don't think I could give it in good conscience.

    You should redesign your whole application so that it doesn't require storing such things in the database. I can't imagine why it would be necessary.

提交回复
热议问题