login  Naam:   Wachtwoord: 
Registreer je!
 Forum

undefined ref regel 14 en 20

Offline Ludo - 11/11/2007 18:42 (laatste wijziging 11/11/2007 18:43)
Avatar van LudoOnbekend

hieronder mijn controlle script waar ik een undefined melding krijg op regel 14 en 20

dat wil zeggen op het moment dat er geen cookie of sessie gevonden word zegt ie dat ref undefined is logisch maar hoe los ik dit op?
  1. <?php
  2. ini_set ('display errors', 1); // 0 = uit, 1 = aan
  3.  
  4.  
  5. // The variable below is the only one you should change.
  6. // Create copies of this file for each different reward ie. check2.php for &#65533;5,
  7.  
  8. check3.php for &#65533;4 etc
  9.  
  10. $payment = "0.44";
  11.  
  12. // Do not edit anything below this line
  13. include "affconfig.php";
  14.  
  15. $ref = $_COOKIE["ref"];
  16. if ($ref == '')
  17. {
  18. if($debugMessage)
  19. echo "<br><font color=#ff0000>PostAffiliate Debug Msg: No referrer found in
  20.  
  21. cookie, trying to use sessions.</font><br>";
  22.  
  23. $ref = $_SESSION["ref"];
  24.  
  25. if($ref == '' && $debugMessage)
  26. echo "<br><font color=#ff0000>PostAffiliate Debug Msg: No referrer found in
  27.  
  28. session.</font><br>";
  29.  
  30. }
  31.  
  32. if ($ref != '')
  33. {
  34. echo "<br><font color=#ff0000>: Referrer '$ref' found, registering
  35.  
  36. sale.</font><br>";
  37.  
  38. mysql_connect($server, $db_user, $db_pass)
  39. or die ("Database CONNECT Error (line 32)");
  40.  
  41. mysql_db_query($database, "INSERT INTO sales VALUES ('$ref', '$clientdate',
  42.  
  43. '$clienttime', '$clientbrowser', '$clientip', '$payment')")
  44. or die("Database INSERT Error (line 34)");
  45. }
  46. ?>

3 antwoorden

Gesponsorde links
Offline lemoinet - 11/11/2007 18:47
Avatar van lemoinet PHP gevorderde
  1. $ref = isset($_COOKIE["ref"]) ? $_COOKIE["ref"] : '';
  2.  
  3. $ref = isset($_SESSION["ref"]) ? $_SESSION["ref"] : '';
Offline Ludo - 11/11/2007 18:54 (laatste wijziging 11/11/2007 18:55)
Avatar van Ludo Onbekend Notice: Undefined index: ref in /home/escort/domains/.nl/public_html/kontroleer.php on line 18

Notice: Undefined variable: _SESSION in /home/escort/domains/l/public_html/kontroleer.php on line 24

  1. <?php
  2. ini_set ('display errors', 1); // 0 = uit, 1 = aan
  3.  
  4.  
  5. $ref = isset($_COOKIE["ref"]) ? $_COOKIE["ref"] : '';
  6.  
  7. $ref = isset($_SESSION["ref"]) ? $_SESSION["ref"] : '';
  8.  
  9. // The variable below is the only one you should change.
  10. // Create copies of this file for each different reward ie. check2.php for &#65533;5,
  11.  
  12. check3.php for &#65533;4 etc
  13.  
  14. $payment = "0.44";
  15.  
  16. // Do not edit anything below this line
  17. include "affconfig.php";
  18.  
  19. $ref = $_COOKIE["ref"];
  20. if ($ref == '')
  21. {
  22. if($debugMessage)
  23. echo "<br><font color=#ff0000>PostAffiliate Debug Msg: No referrer found in
  24.  
  25. cookie, trying to use sessions.</font><br>";
  26.  
  27. $ref = $_SESSION["ref"];
  28.  
  29. if($ref == '' && $debugMessage)
  30. echo "<br><font color=#ff0000>PostAffiliate Debug Msg: No referrer found in
  31.  
  32. session.</font><br>";
  33.  
  34. }
  35.  
  36. if ($ref != '')
  37. {
  38. echo "<br><font color=#ff0000>: Referrer '$ref' found, registering
  39.  
  40. sale.</font><br>";
  41.  
  42. mysql_connect($server, $db_user, $db_pass)
  43. or die ("Database CONNECT Error (line 32)");
  44.  
  45. mysql_db_query($database, "INSERT INTO sales VALUES ('$ref', '$clientdate',
  46.  
  47. '$clienttime', '$clientbrowser', '$clientip', '$payment')")
  48. or die("Database INSERT Error (line 34)");
  49. }
  50. ?>
Offline lemoinet - 11/11/2007 18:57
Avatar van lemoinet PHP gevorderde
  1. <?php
  2. ini_set ('display errors', 1); // 0 = uit, 1 = aan
  3.  
  4.  
  5. // The variable below is the only one you should change.
  6. // Create copies of this file for each different reward ie. check2.php for &#65533;5, check3.php for &#65533;4 etc
  7.  
  8. $payment = "0.44";
  9.  
  10. // Do not edit anything below this line
  11. include "affconfig.php";
  12.  
  13. $ref = isset($_COOKIE["ref"]) ? $_COOKIE["ref"] : '';
  14. if ($ref == '')
  15. {
  16. if($debugMessage)
  17. echo "<br><font color=#ff0000>PostAffiliate Debug Msg: No referrer found in
  18.  
  19. cookie, trying to use sessions.</font><br>";
  20.  
  21. $ref = isset($_SESSION["ref"]) ? $_SESSION["ref"] : '';
  22.  
  23. if($ref == '' && $debugMessage)
  24. echo "<br><font color=#ff0000>PostAffiliate Debug Msg: No referrer found in
  25.  
  26. session.</font><br>";
  27.  
  28. }
  29.  
  30. if ($ref != '')
  31. {
  32. echo "<br><font color=#ff0000>: Referrer '$ref' found, registering
  33.  
  34. sale.</font><br>";
  35.  
  36. mysql_connect($server, $db_user, $db_pass)
  37. or die ("Database CONNECT Error (line 32)");
  38.  
  39. mysql_db_query($database, "INSERT INTO sales VALUES ('$ref', '$clientdate',
  40.  
  41. '$clienttime', '$clientbrowser', '$clientip', '$payment')")
  42. or die("Database INSERT Error (line 34)");
  43. }
  44. ?>
Gesponsorde links
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.217s