login  Naam:   Wachtwoord: 
Registreer je!
 Forum

affiliate bug

Offline Ludo - 09/11/2007 17:46 (laatste wijziging 09/11/2007 17:54)
Avatar van LudoOnbekend hij drukt de orders dubbel af

dus als er 1 sale van 0.44 cent is

time 12.44 0.44
time 12.44 0.44
total 0.88

terwijl er maar 1 sale is

dit is tjek.php

  1. <?php
  2. // The variable below is the only one you should change.
  3. // Create copies of this file for each different reward ie. check2.php for &#65533;5, check3.php for &#65533;4 etc
  4.  
  5. $payment = "0.44";
  6.  
  7. // Do not edit anything below this line
  8. include "affconfig.php";
  9.  
  10. $ref = $HTTP_COOKIE_VARS["ref"];
  11. if ($ref == '')
  12. {
  13. if($debugMessage)
  14. echo "<br><font color=#ff0000>PostAffiliate Debug Msg: No referrer found in cookie, trying to use sessions.</font><br>";
  15.  
  16. $ref = $_SESSION["ref"];
  17.  
  18. if($ref == '' && $debugMessage)
  19. echo "<br><font color=#ff0000>PostAffiliate Debug Msg: No referrer found in session.</font><br>";
  20.  
  21. }
  22.  
  23. if ($ref != '')
  24. {
  25. echo "<br><font color=#ff0000>: Referrer '$ref' found, registering sale.</font><br>";
  26.  
  27. mysql_connect($server, $db_user, $db_pass)
  28. or die ("Database CONNECT Error (line 32)");
  29.  
  30. mysql_db_query($database, "INSERT INTO sales VALUES ('$ref', '$clientdate', '$clienttime', '$clientbrowser', '$clientip', '$payment')")
  31. or die("Database INSERT Error (line 34)");
  32. }
  33. ?>
  34.  
  35. en dit de eerste regeld van orderbevestigings script
  36.  
  37. <?php
  38.  
  39. include "header.php"; // de header (logo/menu/etc)
  40. include "tjek.php"; // controlle payment
  41.  
  42.  
  43.  
  44. // Toevoegen
  45. if(isset( $_POST['ADD']) && ereg('^[1-9][0-9]*$', $_POST['aantal']))
  46.  
  47. ?>

6 antwoorden

Gesponsorde links
Offline Rik - 09/11/2007 18:25
Avatar van Rik Gouden medailleGouden medaille

Crew algemeen
Ik zie helemaal geen script dat iets uit de database echoët?  
Offline Ludo - 09/11/2007 18:29 (laatste wijziging 09/11/2007 19:31)
Avatar van Ludo Onbekend
  1. <?
  2.  
  3. include "../affconfig.php";
  4. include "./lang/$language";
  5.  
  6. if(!aff_check_security())
  7. {
  8. aff_redirect('index.php');
  9. }
  10.  
  11. include "header.php";
  12.  
  13. mysql_connect($server, $db_user, $db_pass)
  14. or die ("Database CONNECT Error (line 18)");
  15. $result = mysql_db_query($database, "select * from sales where refid = '".$_SESSION['aff_valid_user']."' ORDER BY date and time")
  16. or die ("Database INSERT Error");
  17.  
  18. echo "<br><br><font face=arial>".AFF_S_SALES.": ";
  19. print "<br><br>";
  20.  
  21. if (mysql_num_rows($result))
  22. {
  23. print "<font face=arial><TABLE border=1 cellspacing=0 cellpadding=5>";
  24. echo "<TR><TH>".AFF_G_DATE."</TH><TH>".AFF_G_TIME."</TH>";
  25. echo "<TH>".AFF_S_EARNED."</TH></TR>";
  26. while ($qry = mysql_fetch_array($result))
  27. {
  28. print "<TR>";
  29. print "<TD><font size=2>";
  30. print $qry[date];
  31. print "</TD>";
  32. print "<TD><font size=2>";
  33. print $qry[time];
  34. print "</TD>";
  35. print "<TD><font size=2>";
  36. print $qry[payment];
  37. print " ";
  38. print $currency;
  39. print "</TD>";
  40. print "</TR>";
  41. }
  42. print "</TABLE>";
  43. }
  44.  
  45. print "<br><br>".AFF_S_TOTAL.": ";
  46. mysql_connect($server, $db_user, $db_pass)
  47. or die ("Database CONNECT Error (line 47)");
  48. $set = mysql_db_query($database, "select SUM(payment) AS total from sales where refid = '".$_SESSION['aff_valid_user']."'")
  49. or die ("Database INSERT Error (line 48)");
  50. $row = mysql_fetch_array( $set );
  51. print ($row['total'] != '' ? $row['total'] : '0');
  52. print " ";
  53. print $currency;
  54. print "<br><br>";
  55.  
  56. include "footer.php";
  57. ?>
Offline Godlord - 09/11/2007 18:57
Avatar van Godlord PHP gevorderde Je bent [/code] vergeten .
Offline Ludo - 09/11/2007 19:32
Avatar van Ludo Onbekend Wat er eigenlijk gebeurt er word dubbel in database gepost
  1. <?
  2.  
  3. include "../affconfig.php";
  4. include "./lang/$language";
  5.  
  6. if(!aff_check_security())
  7. {
  8. aff_redirect('index.php');
  9. }
  10.  
  11. include "header.php";
  12.  
  13. mysql_connect($server, $db_user, $db_pass)
  14. or die ("Database CONNECT Error (line 18)");
  15. $result = mysql_db_query($database, "select * from sales where refid = '".$_SESSION['aff_valid_user']."' ORDER BY date and time")
  16. or die ("Database INSERT Error");
  17.  
  18. echo "<br><br><font face=arial>".AFF_S_SALES.": ";
  19. print "<br><br>";
  20.  
  21. if (mysql_num_rows($result))
  22. {
  23. print "<font face=arial><TABLE border=1 cellspacing=0 cellpadding=5>";
  24. echo "<TR><TH>".AFF_G_DATE."</TH><TH>".AFF_G_TIME."</TH>";
  25. echo "<TH>".AFF_S_EARNED."</TH></TR>";
  26. while ($qry = mysql_fetch_array($result))
  27. {
  28. print "<TR>";
  29. print "<TD><font size=2>";
  30. print $qry[date];
  31. print "</TD>";
  32. print "<TD><font size=2>";
  33. print $qry[time];
  34. print "</TD>";
  35. print "<TD><font size=2>";
  36. print $qry[payment];
  37. print " ";
  38. print $currency;
  39. print "</TD>";
  40. print "</TR>";
  41. }
  42. print "</TABLE>";
  43. }
  44.  
  45. print "<br><br>".AFF_S_TOTAL.": ";
  46. mysql_connect($server, $db_user, $db_pass)
  47. or die ("Database CONNECT Error (line 47)");
  48. $set = mysql_db_query($database, "select SUM(payment) AS total from sales where refid = '".$_SESSION['aff_valid_user']."'")
  49. or die ("Database INSERT Error (line 48)");
  50. $row = mysql_fetch_array( $set );
  51. print ($row['total'] != '' ? $row['total'] : '0');
  52. print " ";
  53. print $currency;
  54. print "<br><br>";
  55.  
  56. include "footer.php";
  57. ?>
Offline Rik - 09/11/2007 19:34
Avatar van Rik Gouden medailleGouden medaille

Crew algemeen
Op regel 21 echo je het aantal resultaten, wat komt daar uit?

Als daar 2 uit komt gaat er bij het ophalen uit de database iets mis (want hij hoort er maar 1 op te halen) en als er 1 uit komt gaat er dus iets fout in je php code.

Ik zie nu niet iets dat twee keer echoët.
Offline Ludo - 09/11/2007 19:35 (laatste wijziging 09/11/2007 19:36)
Avatar van Ludo Onbekend Er staan 2 resultaten in de DB dus echo hij er 2

Sales From Your Site: 2

Date Time You Earned
2007-11-09 19:33:09 0.44 Euro
2007-11-09 19:33:09 0.44 Euro


Your Total Earnings Are: 0.88 Euro
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.218s