Error md5 offertoro

Asked

Viewed 79 times

-4

Well I am creating a site, where users earn points when completing offers, and when completing the system gives points.

Yet I have the following code:

<?php
$oid = $_GET["oid"];
$amount = $_GET["amount"];
$id = $_GET["userid"];
$payout = $_GET["payout"];
$sig = $_GET["sig"];
$key = "Minha key";
$secret = md5($oid  + "-" + $id + "-" + $key);
$postback = 1;

if($secret == $sig){

    echo $postback;

}



?>

In other words, if Sig is equal to secret, the user is credited with points, however I am testing directly from the offertoro site and this is not working, I mean Sig is different from secret, it means that there is something wrong in secret.

I was wondering if Function md5, is respecting the parameters, or if there’s something wrong.

Key = 756ddad67f428a1db92ee0a2870005a4

Here’s the website where I got this:

http://www.offertoro.com/docs

Just pull it down and they’ll find.

Thank you.

  • 1

    Missing offer and User ID. And this line has error: $id = $_GET["userid"];

  • I already did it! the error was accurate in the "_" that was missing! Thank you for helping me.

  • 1

    Thank you ;) For the next I put more details.

1 answer

2


You can not do many tests with what was posted in the question, but one thing is certain: in PHP, it is not used + to concatenate strings.

This line has problems:

$secret = md5( $oid  + "-" + $id + "-" + $key );

Right:

$secret = md5( $oid . "-" . $id . "-" . $key );

Another problem, the _ along those lines:

$id = $_GET["user_id"];

Remember that spaces and upper and lower case also make a difference to the md5

  • 1

    Thanks for helping me!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.