Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [MySQL][PHP] Zmienna $_GET
JulekJP
post 11.03.2010, 16:02:59
Post #1





Grupa: Zarejestrowani
Postów: 41
Pomógł: 1
Dołączył: 7.03.2009

Ostrzeżenie: (0%)
-----


Witam, mam dość skomplikowany problem dla mnie i nie wiem jak go wyrazić.. Po prostu chce zrobić zmienna GET gdzie w adresie np dodam ?krok=edytuj&id=[id_usera] to mi wyświetli dane z bazy danych tylko o id usera podanym w adresie(get). Prosił bym o pomoc. Poniżej podaje skrypt pliku..

  1. <?php
  2. require("../manicore.php");
  3. require("../header.php");
  4. if (!$datauser['user_level'] == 103)
  5. { header("Location: ../login.php"); exit; } else {
  6. $krok = $_GET['krok'];
  7. $result = mysql_query("SELECT * FROM user ORDER BY user_name");
  8. $data = mysql_fetch_assoc($result);
  9.  
  10. echo "<div id=\"conten\">
  11. <div id=\"conten_01\">";
  12. if ($krok == "edytuj&amp;id=".$data['id'])
  13. {
  14. echo " czesc";
  15. }
  16. if (!$krok)
  17. {
  18. ?>
  19. <table width="70%" border="0">
  20. <tr>
  21. <td><strong>Nazwa klienta</strong></td>
  22. <td align="center"><strong>Typ</strong></td>
  23. <td><strong>Opcje</strong></td>
  24. </tr>
  25. <?php
  26. for($i = 0; $i < mysql_num_rows($result); $i++)
  27. {
  28. $data = mysql_fetch_assoc($result);
  29. echo "<tr>
  30. <td>".$data['user_names']." ".$data['user_name']."</td>
  31. <td>".getuserlevel($data['user_level'])."</td>
  32. <td>[edytuj] | [usuń]</td>
  33. </tr>";
  34. }
  35.  
  36. }
  37. echo "</table>";
  38. echo "<br class=\"clearfloat\" />";
  39. echo "</div>";
  40. }
  41. require("../footer.php");
  42. ?>


Jak widać zrobiłem to tak.. ;|
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Wersja Lo-Fi Aktualny czas: 18.08.2025 - 21:50