如何用PHP寄回

发布于 2025-01-25 01:45:07 字数 1286 浏览 4 评论 0原文

我将此URL获取到我的php服务器:

https://example.com/index.php?status=1&trans_id=10081975462&user_id=WrUbd8WXgrcVrvP0AtaSgHmatMw2&amount_local=175.0000&amount_usd=0.50&offer_id=1&hash=59e5e01bb8d43a59dfa916de06aab9eb&ip_click=78.122.32.238

要从查询URL检索参数:

$status = $_GET['status'];
$trans_id = $_GET['trans_id'];
$user_id = $_GET['user_id'];
$amount_local = $_GET['amount_local'];
$amount_usd = $_GET['amount_usd'];
$offer_id = $_GET['offer_ID'];
$hash = $_GET['secure_hash'];
$ip_click = $_GET['ip_click'];

然后,文档告诉我:

{secure_hash}在这里我们有一个哈希,您可以验证请求该请求是md5哈希:

示例:md5({trans_id} -yourappsecurehash)

']

{secure_hash}它是$ hash = $ _get [' secure_hash /code>是我在仪表板中明显与我的应用程序相关联的私人哈希,

我不确定我是否正确理解了此部分,但这是我的代码:

$app_secure_hash = "xxxxxxxxxxx";

if (md5($status.$trans_id.$user_id.$amount_local.$amount_usd.$offer_id.$hash.$ip_click) != $app_secure_hash) {
        
   echo "500";
       
} else {

   echo "200";
       
}

它总是返回echo echo“ 500”;

您有解决方案

? nofollow noreferrer“> https://i.sstatic.net/kahrj.jpg

I get this url to my php server:

https://example.com/index.php?status=1&trans_id=10081975462&user_id=WrUbd8WXgrcVrvP0AtaSgHmatMw2&amount_local=175.0000&amount_usd=0.50&offer_id=1&hash=59e5e01bb8d43a59dfa916de06aab9eb&ip_click=78.122.32.238

To retrieve the parameters from query URL I did like this :

$status = $_GET['status'];
$trans_id = $_GET['trans_id'];
$user_id = $_GET['user_id'];
$amount_local = $_GET['amount_local'];
$amount_usd = $_GET['amount_usd'];
$offer_id = $_GET['offer_ID'];
$hash = $_GET['secure_hash'];
$ip_click = $_GET['ip_click'];

Then the documentation tells me this:

{secure_hash} here we had a hash that you can validate the request the hash is a md5 hash:

example: md5({trans_id}-yourappsecurehash)

{secure_hash} it's $hash = $_GET['secure_hash'];

yourappsecurehash it's my private hash associated with my application visibly in my dashboard

I'm not sure I understood this section correctly, but here is my code:

$app_secure_hash = "xxxxxxxxxxx";

if (md5($status.$trans_id.$user_id.$amount_local.$amount_usd.$offer_id.$hash.$ip_click) != $app_secure_hash) {
        
   echo "500";
       
} else {

   echo "200";
       
}

It always returns echo "500";

Do you have a solution ?

Below is a photo of the weak documentation on the website

https://i.sstatic.net/kAhrj.jpg

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

裂开嘴轻声笑有多痛 2025-02-01 01:45:07

从文档中,您只需要检查trans_id而不是所有参数。另外,您可能必须改变条件。因此,请尝试以下代码

$app_secure_hash = "xxxxxxxxxxx";

if (md5($trans_id.'-'.$app_secure_hash) != $hash) {
        
   echo "500";
       
} else {

   echo "200";
       
}

From the document you only has to check trans_id and not all parameters. Also you may have to change condition. So try below code

$app_secure_hash = "xxxxxxxxxxx";

if (md5($trans_id.'-'.$app_secure_hash) != $hash) {
        
   echo "500";
       
} else {

   echo "200";
       
}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文