Can one .PHP file edit another?

前端 未结 8 1899
无人共我
无人共我 2021-02-03 16:12

So I have a file for constants. I want to let user define them and then edit my .php filr with that global constants (not xml - real PHP file )

With such code for exampl

8条回答
  •  离开以前
    2021-02-03 16:20

    Not talking about security, one simple way is that you can read the php file using reading functions like file_get_contents and once you have the contents, you should show them in some textarea where your users could edit it. Once they edit it and submit the form, you should update the info.

提交回复
热议问题