Daopay pincode verificatie
Ik zit met het volgende probleem. Men kan bij mij via daopay punten bestellen door te bellen met daopay. Nu is het de bedoeling dat man na het bellen terug word gebracht naar de website ( so far so good ) en dat de punten automatisch bij de beller zijn/haar account worden opgeteld. ( not so good )
De verificatie van daopay krijg ik maar niet goed, continu de melding PIN code invalid/expired.
Iemand van jullie een idee/suggestie ?
Alvast bedankt
Hieronder de code :
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<?
$appcode = 45566; // Enter your Appcode here
$prodcode = trim($_GET["subkey"]);
$pin = trim($_GET["pin"]);
if($appcode != $_GET["tidkey"]) {
exit;
}
if (strlen($prodcode) && strlen($pin)) {
$handle = fopen("http://daopay.com/svc/pincheck?appcode=".$appcode."&prodcode=".$prodcode."&pin=".$pin, "r");
if ($handle) {
$reply = fgets($handle);
if (substr($reply,0,2) == "ok") {
$Accountcheck = "SELECT * FROM login WHERE name = '" .mysql_real_escape_string($name). "'";
$query = mysql_query($Accountcheck) or die(mysql_error());
$count = mysql_num_rows($query);
if(($count != "1") and ($prodcode == 'EG20')){
mysql_query("UPDATE login SET credits = credits + 20 WHERE name = '$name'");
$sql = "INSERT INTO dp_claim SET id = '', Account = '" .mysql_real_escape_string($name). "', Pin = '".mysql_real_escape_string($_GET['pin'])."', datum = 'NULL', Subkey ='$subkey'";
$res = mysql_query($sql);
?><center><b><? echo '20'; echo ' points sent to '; echo $name;
}
if(($count != "1") and ($prodcode == 'EG120')){
mysql_query("UPDATE login SET credits = credits + 120 WHERE name = '" .mysql_real_escape_string($name). "'");
$sql = "INSERT INTO dp_claim SET id = '', Account = '" .mysql_real_escape_string($name). "', Pin = '".mysql_real_escape_string($_GET['pin'])."', datum = 'NULL', Subkey ='$subkey'";
$res = mysql_query($sql);
?><center><b><? echo '120'; echo ' points sent to '; echo $name;
}
if(($count != "1") and ($prodcode == 'EG260')){
mysql_query("UPDATE login SET credits = credits + 260 WHERE name = '" .mysql_real_escape_string($name). "'");
$sql = "INSERT INTO dp_claim SET id = '', Account = '" .mysql_real_escape_string($name). "', Pin = '".mysql_real_escape_string($_GET['pin'])."', datum = 'NULL', Subkey ='$subkey'";
$res = mysql_query($sql);
?><center><b><? echo '260'; echo ' points sent to '; echo $name;
}
if(($count != "1") and ($prodcode == 'EG550')){
mysql_query("UPDATE login SET credits = credits + 550 WHERE name = '" .mysql_real_escape_string($name). "'");
$sql = "INSERT INTO dp_claim SET id = '', Account = '" .mysql_real_escape_string($name). "', Pin = '".mysql_real_escape_string($_GET['pin'])."', datum = 'NULL', Subkey ='$subkey'";
$res = mysql_query($sql);
?><center><b><? echo '550'; echo ' points sent to '; echo $name;
}
}
else {
// PIN code invalid/expired
echo "<font color='#ff0000'><b>Dear $name , PIN code invalid/expired, please contact someone from staff</b></font>";
}
}
else {
// Connection error
echo "<font color='#ff0000'><b>Connection error: Can not connect to Daopay</b></font>";
}
}
?>
$appcode = 45566; // Enter your Appcode here
$prodcode = trim($_GET["subkey"]);
$pin = trim($_GET["pin"]);
if($appcode != $_GET["tidkey"]) {
exit;
}
if (strlen($prodcode) && strlen($pin)) {
$handle = fopen("http://daopay.com/svc/pincheck?appcode=".$appcode."&prodcode=".$prodcode."&pin=".$pin, "r");
if ($handle) {
$reply = fgets($handle);
if (substr($reply,0,2) == "ok") {
$Accountcheck = "SELECT * FROM login WHERE name = '" .mysql_real_escape_string($name). "'";
$query = mysql_query($Accountcheck) or die(mysql_error());
$count = mysql_num_rows($query);
if(($count != "1") and ($prodcode == 'EG20')){
mysql_query("UPDATE login SET credits = credits + 20 WHERE name = '$name'");
$sql = "INSERT INTO dp_claim SET id = '', Account = '" .mysql_real_escape_string($name). "', Pin = '".mysql_real_escape_string($_GET['pin'])."', datum = 'NULL', Subkey ='$subkey'";
$res = mysql_query($sql);
?><center><b><? echo '20'; echo ' points sent to '; echo $name;
}
if(($count != "1") and ($prodcode == 'EG120')){
mysql_query("UPDATE login SET credits = credits + 120 WHERE name = '" .mysql_real_escape_string($name). "'");
$sql = "INSERT INTO dp_claim SET id = '', Account = '" .mysql_real_escape_string($name). "', Pin = '".mysql_real_escape_string($_GET['pin'])."', datum = 'NULL', Subkey ='$subkey'";
$res = mysql_query($sql);
?><center><b><? echo '120'; echo ' points sent to '; echo $name;
}
if(($count != "1") and ($prodcode == 'EG260')){
mysql_query("UPDATE login SET credits = credits + 260 WHERE name = '" .mysql_real_escape_string($name). "'");
$sql = "INSERT INTO dp_claim SET id = '', Account = '" .mysql_real_escape_string($name). "', Pin = '".mysql_real_escape_string($_GET['pin'])."', datum = 'NULL', Subkey ='$subkey'";
$res = mysql_query($sql);
?><center><b><? echo '260'; echo ' points sent to '; echo $name;
}
if(($count != "1") and ($prodcode == 'EG550')){
mysql_query("UPDATE login SET credits = credits + 550 WHERE name = '" .mysql_real_escape_string($name). "'");
$sql = "INSERT INTO dp_claim SET id = '', Account = '" .mysql_real_escape_string($name). "', Pin = '".mysql_real_escape_string($_GET['pin'])."', datum = 'NULL', Subkey ='$subkey'";
$res = mysql_query($sql);
?><center><b><? echo '550'; echo ' points sent to '; echo $name;
}
}
else {
// PIN code invalid/expired
echo "<font color='#ff0000'><b>Dear $name , PIN code invalid/expired, please contact someone from staff</b></font>";
}
}
else {
// Connection error
echo "<font color='#ff0000'><b>Connection error: Can not connect to Daopay</b></font>";
}
}
?>
Gewijzigd op 01/01/1970 01:00:00 door Dennis
heb dit aangepast
Code (php)
en dan heb ik geen foutmeldign meer...maar dan loopt het ergens toch fout. Denk een query..maar waar en hoe
iig bedankt voor je reactie
geen resultaat, zal het daar liggen...maar ja...wat nu. denk dat ik er zo maar even mee ophoud. Ken mijn scherm nu van binnen en buiten na 5 uur :-s
if ($handle) {
$reply = fgets($handle);
if (substr($reply,0,2) == "ok") {"
probeer het voor de gein eens om die link te openen met file_get_contents, en geen substr oid te gebruiken?
dus
$reply = file_get_contents("úŕĺ");
if($reply == 'ok');