Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Dlaczego nie widzi zmiennej pobranej z tablicy $_GET, zmienna pobrana z GET - wysyłana w POST
shpaque
post
Post #1





Grupa: Zarejestrowani
Postów: 651
Pomógł: 3
Dołączył: 31.01.2011
Skąd: Warszawa

Ostrzeżenie: (10%)
X----


Witam, mam problem z odnalezieniem babola. Może Wam się uda? (wskakuje mi ciągle error page) "$akod" zdefiniowany jest dalej jako "$akod = $_GET['akod'];"

  1. <?php
  2. if ($_SERVER['REQUEST_METHOD'] == 'POST' && strlen($_POST['nowa']))
  3. {
  4. $xnowa = addslashes($_POST['nowa']);
  5. $xusername = $_SESSION['username'];
  6. $found = false;
  7. $logtimes = array();
  8. $xtimes = array();
  9. $ximages = array();
  10. $xcodes = array();
  11. $xnames = array();
  12. $xsizes = array();
  13. $xfirmas = array();
  14. $xsquads = array();
  15. $xopiss = array();
  16. $xcenas = array();
  17. $xusers = array();
  18. $activeaccounts = array();
  19. $count = 0;
  20. $success_page = './aukcje.php';
  21. $error_page = './aerror.php';
  22. $database = './db/aukcje.csv';
  23.  
  24. if (filesize($database) == 0)
  25. {
  26. header('Location: '.$error_page);
  27. }
  28. else
  29. {
  30. $items = file($database);
  31. foreach($items as $line)
  32. {
  33. list($logtime, $xtime, $ximage, $xcode, $xname, $xsize, $xfirma, $xsquad, $xopis, $xcena, $xuser, $active) = explode('|', trim($line));
  34. $logtimes[$count] = $logtime;
  35. $xtimes[$count] = $xtime;
  36. $ximages[$count] = $ximage;
  37. $xcodes[$count] = $xcode;
  38. $xnames[$count] = $xname;
  39. $xsizes[$count] = $xsize;
  40. $xfirmas[$count] = $xfirma;
  41. $xsquads[$count] = $xsquad;
  42. $xopiss[$count] = $xopis;
  43. $xcenas[$count] = $xcena;
  44. $xusers[$count] = $xuser;
  45. $activeaccounts[$count] = $active;
  46. if ($akod == $xcode)
  47. {
  48. $found = true;
  49. }
  50. $count++;
  51. }
  52. }
  53. if ($found == true)
  54. {
  55. $file = fopen($database, 'w');
  56. for ($i=0; $i < $count; $i++)
  57. {
  58. fwrite($file, $logtimes[$i]);
  59. fwrite($file, '|');
  60. fwrite($file, $xtimes[$i]);
  61. fwrite($file, '|');
  62. fwrite($file, $ximages[$i]);
  63. fwrite($file, '|');
  64. fwrite($file, $xcodes[$i]);
  65. fwrite($file, '|');
  66. fwrite($file, $xnames[$i]);
  67. fwrite($file, '|');
  68. fwrite($file, $xsizes[$i]);
  69. fwrite($file, '|');
  70. fwrite($file, $xfirmas[$i]);
  71. fwrite($file, '|');
  72. fwrite($file, $xsquads[$i]);
  73. fwrite($file, '|');
  74. fwrite($file, $xopiss[$i]);
  75. fwrite($file, '|');
  76. if ($xcodes[$i] == $xcode)
  77. {
  78. fwrite($file, $xnowa);
  79. fwrite($file, '|');
  80. fwrite($file, $xusername);
  81. }
  82. else
  83. {
  84. fwrite($file, $xcenas[$i]);
  85. fwrite($file, '|');
  86. fwrite($file, $xusers[$i]);
  87. }
  88. fwrite($file, '|');
  89. fwrite($file, $activeaccounts[$i]);
  90. fwrite($file, "\r\n");
  91. }
  92. fclose($file);
  93. header('Location: '.$success_page);
  94. }
  95. else
  96. {
  97. header('Location: '.$error_page);
  98. }
  99. }
  100. ?>


Ten post edytował shpaque 16.08.2011, 22:27:26
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
wookieb
post
Post #2





Grupa: Moderatorzy
Postów: 8 989
Pomógł: 1550
Dołączył: 8.08.2008
Skąd: Słupsk/Gdańsk




Temat ma opisywać problem z jakim się spotkałeś. Aktualny tego NIE ROBI. Wszyscy tu potrzebują pomocy więc nie potrzebujemy błagalnych tonów "Może mi ktoś pomóc?".
Poza tym co to wg Ciebie jest "error page" bo ja znam ich z parenaście rodzajów.
Zamykam.
Dodatkowo odsyłam do Temat: Jak poprawnie zadac pytanie gdzie nauczysz się jak DEBUGOWAĆ zmienne, choć już taką poradę dostałeś.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 25.12.2025 - 21:19