saving json data to json file using ajax PHP

前端 未结 2 1364
伪装坚强ぢ
伪装坚强ぢ 2021-01-17 02:45

My json file looks like this:

count_click.json

[
  {
    \"link\": \"google.com\",
    \"count\": 2  
  },
  {
    \"link\": \"yah         


        
2条回答
  •  孤街浪徒
    2021-01-17 02:55

    You could edit your PHP:

    You really should check that posted data to be valid and not saving something unwanted. Also you could check that request really is POST -> $_SERVER['REQUEST_METHOD'].

    Maybe you find some other methods to improve security (for example only allow post from own domain...).

提交回复
热议问题