How to prevent cross-domain ajax requests?

后端 未结 6 1183
闹比i
闹比i 2020-12-05 16:43

How can I detect if my php script is being called from another domain and the other domain is making illegal use of my script? Is there a way to prevent this too?

<

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 17:27

    This isn't a problem that can be solved. If you create a website you make it, by definition, openly available.
    If you want your data to be private, you need to require some sort of login.

    It is impossible to create a system that is open to users but not to scripts without login/annoying captchas.

提交回复
热议问题