Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP]Nazwa PHP
Sign
post
Post #1





Grupa: Zarejestrowani
Postów: 128
Pomógł: 0
Dołączył: 3.11.2014

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


Czesc, co zrobic, aby po dodaniu tabelki i wpisaniu w pole "nazwa" ( www.csleague.xaa.pl/sklepek/dodaj.php )
na samej górze pokazywala sie ta wlasnie nazwa.
[url="xxx[/url] obok tego tekstu ( pociongi )


kod dodaj.php
  1. <form action="" method="post">
  2. Nazwa itema: <input type="text" name="tytul">
  3. Item: <input name="file[]" type="file">
  4.  
  5. <br/><input type="submit" value="Dodaj">
  6. </form>
  7.  
  8. <?php
  9. include("config.php");
  10. if($_SERVER['REQUEST_METHOD'] == 'POST')
  11. {
  12. $query = mysql_query("insert into news values('".$_POST['tytul']."',now()')");
  13. }
  14. ?>
  15.  
  16.  



index.php

  1. <?php
  2. $query = mysql_query("select * from news order by id desc limit 0,5"); // 2
  3. while($rekord = mysql_fetch_array($query))
  4. {
  5.  
  6. $naz .= ' <div class="item">
  7. <div class="nazwa"> '.$rekord[4].' pociongi</div>
  8. <div class="itemek"></div>
  9.  
  10. <div class="kup"><a href="news.php?id='.$rekord[0].'">Kup</a></div>
  11.  
  12. </div>';
  13. }
  14.  
  15. echo '<ul>'.$naz.'</ul>'; // 4
  16. ?>
Powód edycji: [Kshyhoo]: usunięty link - wulgaryzmy na stronie
Go to the top of the page
+Quote Post
nvb
post
Post #2





Grupa: Zarejestrowani
Postów: 28
Pomógł: 3
Dołączył: 6.01.2015

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


dodać echo przed zmienną którą chcesz wyświetlić?
o ile dobrze Cię zrozumiałem.
I co to są "pociongi" ?
Go to the top of the page
+Quote Post
MESSIAH :)
post
Post #3





Grupa: Zarejestrowani
Postów: 249
Pomógł: 0
Dołączył: 22.12.2011

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


Pociongi? Autorowi pewnie chodziło o maszyny służące komunikacji miejskiej takie jak Tramfaje lub Taksufki.


--------------------
Go to the top of the page
+Quote Post

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 Aktualny czas: 22.08.2025 - 10:24