Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Nieaktywna zmienna
Lethys
post
Post #1





Grupa: Zarejestrowani
Postów: 642
Pomógł: 2
Dołączył: 9.03.2006

Ostrzeżenie: (30%)
XX---


Witam,

Posiadam probelm, zmienna z początku kodu nie jest aktywna pod koniec kodu.

Jak to zrobić?

Kod wygląda tak:

  1. <?php
  2. include "header.php";
  3. include "sesja.php";
  4.  
  5. // TUTAJ POKAZ
  6. $pokaz = mysql_fetch_array(mysql_query("select * from cele where id='$pokaz'"));
  7. ?>
  8. <body>
  9.  
  10. <div id="wrapper">
  11. <div id="header">
  12. <h1>Rozwój osobisty</h1>
  13. <div class="clear"></div>
  14. </div>
  15.  
  16. <div id="middlebar-small">
  17. <h2><?php print "$pokaz[nazwa]"; ?></h2>
  18. </div>
  19.  
  20. <div id="body">
  21. <div id="body-inner">
  22. <div id="sidebar">
  23. <h3 class="user"><?php print "$stat[imie] $stat[nazwisko]";?></h3>
  24. <ul class="links">
  25. <li><a href="#"><img border="0" src="images/sb3.png" width="10" height="10"> Cele</a></li>
  26. <li><a href="#"><img border="0" src="images/stats.png" width="10" height="10"> Statystyki</a></li>
  27. <li><a href="#"><img border="0" src="images/poradniki.png" width="10" height="10"> Poradniki</a></li>
  28. </ul>
  29.  
  30. </div>
  31.  
  32. <div id="main-content">
  33. <div class="box">
  34. <div class="box_inner">
  35. <h3><?php print "$pokaz[nazwa]"; ?></h3>
  36. <p><?php print "$pokaz[opis]"; ?></p>
  37. </div>
  38. </div>
  39. <form method=post action=pokaz.php?action=zrobione>
  40. <ul class="form">
  41. <li><label for="name">Czas</label><input name="czas" type="text" maxlength="10"/></li>
  42. <li><label for="opis">Wnioski</label><textarea name="opis" cols="30" rows="3" maxlength="255"></textarea></li>
  43. <li><label></label> <input class="btn" alt="Zrobione" type="image" name="zrobione" src="images/button.png" />
  44. </li>
  45. </ul>
  46. </form>
  47. <?php
  48. if ($action == "zrobione"){
  49.  
  50.  
  51.  
  52. //if(!preg_match('/^([a-ż0-9_]+)$/i', $_POST['nazwa'])){
  53. //$problem = TRUE;
  54. //echo("<p id='uwaga'><h2>Użyto niedozwolonych znaków w nazwie celu.</h2></p>");
  55. //}
  56. //if(!preg_match('/^([a-ż0-9_]+)$/i', $_POST['opis'])){
  57. //$problem = TRUE;
  58. //echo("<p id='uwaga'><h2>Użyto niedozwolonych znaków w opisie.</h2></p>");
  59. //}
  60.  
  61.  
  62.  
  63. $data = date("d.m.y");
  64.  
  65.  
  66.  
  67. // POKAZ[ID] TUTAJ NIE DZIAŁA, JEST PUSTE
  68.  
  69. mysql_query("insert into akcje (id_cel, opis, czas) values('$pokaz[id]','$opis','$czas')") or die(mysql_error());
  70.  
  71.  
  72.  
  73. echo("<br><p><h2> Nowy cel został utworzony.</h2></p><p>Przejdź do swoich <a href=cele.php>celi</a>");
  74. }
  75.  
  76. ?>
  77.  
  78. </div>
  79. </div>
  80. </div>
  81. <?php
  82. include "footer.php";
  83. ?>
  84. </div>
  85.  
  86. </body>
  87. </html>
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: 19.09.2025 - 21:40