affiliate bug
hieronder mijn controlle script
wat het probleem is dat ik alle order dubbel als sales terug zie dus ipv1 order 2
ipv 2 orders hij drukt dus de orders dubbel af
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
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
<?php
$payment = "0.44";
//
include "affconfig.php";
$ref = $HTTP_COOKIE_VARS["ref"];
if ($ref == '')
{
if($debugMessage)
echo "<br><font color=#ff0000>PostAffiliate Debug Msg: No referrer found in cookie, trying to use sessions.</font><br>";
$ref = $_SESSION["ref"];
if($ref == '' && $debugMessage)
echo "<br><font color=#ff0000>PostAffiliate Debug Msg: No referrer found in session.</font><br>";
}
if ($ref != '')
{
echo "<br><font color=#ff0000>: Referrer '$ref' found, registering sale.</font><br>";
mysql_connect($server, $db_user, $db_pass)
or die ("Database CONNECT Error (line 32)");
mysql_db_query($database, "INSERT INTO sales VALUES ('$ref', '$clientdate', '$clienttime', '$clientbrowser', '$clientip', '$payment')")
or die("Database INSERT Error (line 34)");
}
?>
$payment = "0.44";
//
include "affconfig.php";
$ref = $HTTP_COOKIE_VARS["ref"];
if ($ref == '')
{
if($debugMessage)
echo "<br><font color=#ff0000>PostAffiliate Debug Msg: No referrer found in cookie, trying to use sessions.</font><br>";
$ref = $_SESSION["ref"];
if($ref == '' && $debugMessage)
echo "<br><font color=#ff0000>PostAffiliate Debug Msg: No referrer found in session.</font><br>";
}
if ($ref != '')
{
echo "<br><font color=#ff0000>: Referrer '$ref' found, registering sale.</font><br>";
mysql_connect($server, $db_user, $db_pass)
or die ("Database CONNECT Error (line 32)");
mysql_db_query($database, "INSERT INTO sales VALUES ('$ref', '$clientdate', '$clienttime', '$clientbrowser', '$clientip', '$payment')")
or die("Database INSERT Error (line 34)");
}
?>
hieronder mijn order confirmation page begint zo
Code (php)
Gewijzigd op 01/01/1970 01:00:00 door Lars Koning
Dan word je script gewoon twee keer uitgevoerd.
Het is misschien niet dé fout, maar geeft wel aan dat je een vrij krakkemikkig script te pakken hebt.
Sales From Your Site: 4
Date Time You Earned
2007-11-09 18:28:08 0.44 Euro
2007-11-09 18:28:08 0.44 Euro
2007-11-09 18:25:24 0.44 Euro
2007-11-09 18:25:24 0.44 Euro
Your Total Earnings Are: 1.76 Euro
terwijl er maar 2 sales zijn heb $_Cookie aangepast
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
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
<?
session_start();
include "../affconfig.php";
include "./lang/$language";
if(!aff_check_security())
{
aff_redirect('index.php');
exit;
}
include "header.php";
mysql_connect($server, $db_user, $db_pass)
or die ("Database CONNECT Error (line 18)");
$result = mysql_db_query($database, "select * from sales where refid = '".$_SESSION['aff_valid_user']."' ORDER BY date and time")
or die ("Database INSERT Error");
echo "<br><br><font face=arial>".AFF_S_SALES.": ";
print mysql_num_rows($result);
print "<br><br>";
if (mysql_num_rows($result))
{
print "<font face=arial><TABLE border=1 cellspacing=0 cellpadding=5>";
echo "<TR><TH>".AFF_G_DATE."</TH><TH>".AFF_G_TIME."</TH>";
echo "<TH>".AFF_S_EARNED."</TH></TR>";
while ($qry = mysql_fetch_array($result))
{
print "<TR>";
print "<TD><font size=2>";
print $qry[date];
print "</TD>";
print "<TD><font size=2>";
print $qry[time];
print "</TD>";
print "<TD><font size=2>";
print $qry[payment];
print " ";
print $currency;
print "</TD>";
print "</TR>";
}
print "</TABLE>";
}
print "<br><br>".AFF_S_TOTAL.": ";
mysql_connect($server, $db_user, $db_pass)
or die ("Database CONNECT Error (line 47)");
$set = mysql_db_query($database, "select SUM(payment) AS total from sales where refid = '".$_SESSION['aff_valid_user']."'")
or die ("Database INSERT Error (line 48)");
$row = mysql_fetch_array( $set );
print ($row['total'] != '' ? $row['total'] : '0');
print " ";
print $currency;
print "<br><br>";
include "footer.php";
?>
session_start();
include "../affconfig.php";
include "./lang/$language";
if(!aff_check_security())
{
aff_redirect('index.php');
exit;
}
include "header.php";
mysql_connect($server, $db_user, $db_pass)
or die ("Database CONNECT Error (line 18)");
$result = mysql_db_query($database, "select * from sales where refid = '".$_SESSION['aff_valid_user']."' ORDER BY date and time")
or die ("Database INSERT Error");
echo "<br><br><font face=arial>".AFF_S_SALES.": ";
print mysql_num_rows($result);
print "<br><br>";
if (mysql_num_rows($result))
{
print "<font face=arial><TABLE border=1 cellspacing=0 cellpadding=5>";
echo "<TR><TH>".AFF_G_DATE."</TH><TH>".AFF_G_TIME."</TH>";
echo "<TH>".AFF_S_EARNED."</TH></TR>";
while ($qry = mysql_fetch_array($result))
{
print "<TR>";
print "<TD><font size=2>";
print $qry[date];
print "</TD>";
print "<TD><font size=2>";
print $qry[time];
print "</TD>";
print "<TD><font size=2>";
print $qry[payment];
print " ";
print $currency;
print "</TD>";
print "</TR>";
}
print "</TABLE>";
}
print "<br><br>".AFF_S_TOTAL.": ";
mysql_connect($server, $db_user, $db_pass)
or die ("Database CONNECT Error (line 47)");
$set = mysql_db_query($database, "select SUM(payment) AS total from sales where refid = '".$_SESSION['aff_valid_user']."'")
or die ("Database INSERT Error (line 48)");
$row = mysql_fetch_array( $set );
print ($row['total'] != '' ? $row['total'] : '0');
print " ";
print $currency;
print "<br><br>";
include "footer.php";
?>
Gewijzigd op 01/01/1970 01:00:00 door Lars Koning
Code (php)
1
mysql_db_query($database, "INSERT INTO sales VALUES ('$ref', '$clientdate', '$clienttime', '$clientbrowser', '$clientip', '$payment')")
Je zet het in de tabel 'sales' allerlei dingen, maar je geeft niet aan in welke kolom. Ik weet niet of ik dit goed zeg, mja :P
succes..