how to prevent PHP's file_get_contents( )

后端 未结 4 1664
攒了一身酷
攒了一身酷 2021-01-14 17:23

one of my php page returns data like this:


but someone else use file_get_contents() to get m

4条回答
  •  孤城傲影
    2021-01-14 17:33

    You can use $_SERVER['REMOTE_ADDR'] to get the address of the client address. You can also check $_SERVER['HTTP_REFERER'] and block external requests that way, but it's less reliable. There's probably a few other techniques involving $_SERVER that you can try.

提交回复
热议问题