How to restrict access to a PHP file?

后端 未结 7 1357
故里飘歌
故里飘歌 2021-01-06 20:47

I\'d like to restrict access to a PHP file on my server. This PHP file takes data from an HTTP GET request and appends it to a file. Simple. But I don\'t want this PHP fi

7条回答
  •  爱一瞬间的悲伤
    2021-01-06 21:15

    Just add authorisation (logins, passwords, sessions etc and/or "API keys") to your PHP application and then let your phone app to authorise first before sending the needed requests. You probably didn't consider that because if your script is simple that might add some clutter to it, but then again almost every web system needs that, and you will face that as well eventually.

    Let you phone application to log into your PHP app via HTTPS to exclude interception.

提交回复
热议问题