Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> pole input + automatyczne wyciagniecie danych
Lonas
post
Post #1





Grupa: Zarejestrowani
Postów: 576
Pomógł: 14
Dołączył: 9.11.2005

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


Hej - pytanko moje jest takie :

mam inputa - po wpisaniu do niego liczby 10 cyfrowej ( charakteruzyje produkt ) , jest ona wyszukiwana w bazie i pokazuje mi sie np jej zapas

Próbowałem tak ale coś mi nie działa, może ktoś będzie wiedział w czym rzecz ? (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)

  1. if(isset($_POST["hid"]) && !empty($_POST["hid"]) && $_POST["hid"]!="--") {
  2. $res = mysql_query("select * from top100_sklep where ref='".$_POST["s"]."'");
  3. $dane = mysql_fetch_row($res);
  4. } else {
  5. $dane = array_fill(0,13," ");
  6. }
  7. ?>
  8.  
  9.  
  10. <input id="s" name="s" onChange="document.getElementById('hid').value='submit';this.form.submit()">
  11.  
  12.  
  13.  
  14.  
  15. <input id="hid" name="hid" type="hidden" value="<?$_POST["s"]?>" />
  16.  
  17. <?php echo $dane[3]; ?>
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
nasty
post
Post #2





Grupa: Zarejestrowani
Postów: 634
Pomógł: 14
Dołączył: 27.05.2006
Skąd: Berlin

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


  1. <?php
  2. if(isset($_POST["s"]) && $_POST["s"]!="--") {
  3. $res = mysql_query("select * from top100_sklep where ref='".$_POST["s"]."'");
  4. $dane = mysql_fetch_row($res);
  5. } else {
  6. $dane = array_fill(0,13," ");
  7. ?>

widac nie zrozumiales mnie, teraz dziala ?
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: 26.09.2025 - 11:15