dran0703 2014-11-30 01:44
浏览 16
已采纳

将信息发送到远程服务器[关闭]

I have an application that is written in PHP, and I was wondering how I could have the application send information to a remote server (mine) to tell the server that it has been installed, and how the server would receive it. I could use a database, but then how would I know that the entry is from an actual user and not just someone putting false information in there, but then again, I suppose they could do that anyway, and I suppose that it wouldn't really matter. Basically what I want is for the application to send me what they have set as their URL and what they have the site's title set to. Obviously it would eventually be stored in a database, but should the database entry be from the site that's sending info or the one getting it.

Basically what I am looking for is the best way to do this. Thanks.

  • 写回答

1条回答 默认 最新

  • dora0817 2014-11-30 02:15
    关注

    I would create a RESTful JSON web service in PHP which is always online. It receives the url and the title when your app gets installed. You need to do what you want with the incoming data on the service itself, e.g. store in database. Make sure this part is working first and that data is saving before moving on to trying to use it within your application.

    Then in PHP application you can make a CURL request to the service by POSTing the title and url when it gets installed.

    If you are talking about wordpress plugins then your code is public and it would be obvious to anyone who looks at your code that a service call is made upon installation. It would be easy to spoof and is hard to prevent. The solution is to try to obfuscate the part of the application that makes the CURL request.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥35 引用csv数据文件(4列1800行),通过高斯-赛德尔法拟合曲线,在选取(每五十点取1点)数据,求该数据点的曲率中心。
  • ¥20 程序只发送0X01,串口助手显示不正确,配置看了没有问题115200-8-1-no,如何解决?
  • ¥15 Google speech command 数据集获取
  • ¥15 vue3+element-plus页面崩溃
  • ¥15 像这种代码要怎么跑起来?
  • ¥15 安卓C读取/dev/fastpipe屏幕像素数据
  • ¥15 pyqt5tools安装失败
  • ¥15 mmdetection
  • ¥15 nginx代理报502的错误
  • ¥100 当AWR1843发送完设置的固定帧后,如何使其再发送第一次的帧