Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> drop down menu i obrazki, [pilne][php][mysql][kto wie co jeszcze]
marrrecki
post
Post #1





Grupa: Zarejestrowani
Postów: 110
Pomógł: 0
Dołączył: 19.07.2006
Skąd: Lublin

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


Mam taki problem.

Jak zrobić, żeby zależnie od wybranej opcji z drop down menu wyświetlał mi się obrazek.
Wszystkie dane są pobierane z bazy danych.
Jak to ugryźć?

Mam już zrobione samo pobieranie wartości drop down menu i obrazka. zostało mi utworzenie zależności między nimi.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
marrrecki
post
Post #2





Grupa: Zarejestrowani
Postów: 110
Pomógł: 0
Dołączył: 19.07.2006
Skąd: Lublin

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


przepraszam. już podaje kod funkcji:

  1. <?php
  2. function tep_draw_pull_down_menu($name, $values, $default = '', $parameters = '', $required = false) {
  3. $field = '<select name="' . tep_output_string($name) . '"';
  4.  
  5. if (tep_not_null($parameters)) $field .= ' ' . $parameters;
  6.  
  7. $field .= '>';
  8.  
  9. if (empty($default) && isset($GLOBALS[$name])) $default = stripslashes($GLOBALS[$name]);
  10.  
  11. for ($i=0, $n=sizeof($values); $i<$n; $i++) {
  12. $field .= '<option value="' . tep_output_string($values[$i]['id']) . '"';
  13. if ($default == $values[$i]['id']) {
  14. $field .= ' SELECTED';
  15. }
  16.  
  17. $field .= '>' . tep_output_string($values[$i]['text'], array('"' => '&quot;', ''' => ''', '<' => '&lt;', '>' => '&gt;')) . '</option>';
  18. }
  19. $field .= '</select>';
  20.  
  21. if ($required == true) $field .= TEXT_FIELD_REQUIRED;
  22.  
  23. return $field;
  24. }
  25. ?>
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: 14.10.2025 - 12:21