0

こんにちは、プログラムのデータを収集したいのですが、PHP を使用してこれを行いたいです ( http://site.com/php?v= "0.0.1"&n="Application")。php ページを作成するにはどうすればよいですか?私のプログラムだけを動作させ、他の誰かがリンクを持っていません。

どうすれば確認できますか

4

2 に答える 2

0
  1. Have your users register their software, and on registration give them a user ID. Send that user ID as a get arg to the php page to identify the source of the request.

  2. Have a multistep process for registering stats. Application requests a code from the server, application hashes code with a secret salt, and then application sends this salted hash back to the server along with all the usage data.

In both of these methods, you still can't tell if some user is manufacturing the requests. You're writing the client in Java, which means that no matter how complicated you make the verification process your end application will be decompilable and your methods will be reproducible. The first solution has the advantage of isolating stats from individual users, so if a user does end up trying to screw with your system you could prune all entries from that user.

于 2013-09-29T13:36:38.803 に答える
0

いろいろな方法があると思いますが、一番シンプルなのは

あなたと終了スクリプトだけが知っているある種のトークンをパラメーターに送信します。

http://site.com/php?v=0.0.1&n=Application&token=SDGH36THGB

これで、php スクリプトで、リクエストからトークン パラメータを取得し、すでに保存されているものと照合できます。

if($_GET['token']==$myToken){
   //its my script accessing the page
}else{
   //You can show error or something
}

これでレベル 1になりました。非常に単純ですね。しかし、誰かがあなたが使用しているそのトークンについて知った場合はどうなりますか? 簡単に悪用される可能性があります。

レベル 2は、たとえば、yymmyyddHH 形式の今日の日付として常に toekn を設定するなど、スクリプトが知っている式があります。

これで、スクリプトは、これが正しいかどうかにかかわらず、実際の時間枠に対してこれをチェックできます。したがって、リクエストを行うたびに、現在の時間に応じて異なるトークン値があり、スクリプトはこのトークンを現在の時間フレームと照合します。

誰かが単一のトークンについて知った場合、そのトークンは 1 時間後に機能しなくなるため、複製することもできません。より複雑なロジックを自分で決定できます。

レベル - 3 OAuth - かなり難しいですが、最良の部分は、簡単なグーグルで非常に優れた実装ライブラリをすでに見つけることができることです - https://www.google.co.in/search?q=oauth+in+php&oq=oauth +in+php&aqs=chrome..69i57j0l5.4208j0&sourceid=chrome&espvd=210&es_sm=122&ie=UTF-8

于 2013-09-29T20:13:58.823 に答える