如何用PHP寄回
我将此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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从文档中,您只需要检查
trans_id
而不是所有参数。另外,您可能必须改变条件。因此,请尝试以下代码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