Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][HTML] Wyświetlanie newsa w ramce.
Gabrielx
post
Post #1





Grupa: Zarejestrowani
Postów: 157
Pomógł: 2
Dołączył: 24.03.2009

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


Oto kod wyświetlający newsy:
  1. <?php
  2.  
  3. if (!isset($_REQUEST['strona'])&&!isset($_REQUEST['artykul']))
  4. {
  5.  header('Location: indeks.php');
  6.  exit;
  7. }
  8.  
  9. $strona = $_REQUEST['strona'];
  10. $artykul = intval($_REQUEST['artykul']);
  11.  
  12. include_once('funkcje_bazy.php');
  13. include_once('naglowek.php');
  14.  
  15. $lacz = lacz_bd();
  16.  
  17. if ($artykul)
  18. {
  19.  $sql = "select * from artykuly
  20.          where id = '$artykul' and
  21.                opublikowany is not null";
  22. }
  23. else
  24. {
  25.  $sql = "select * from artykuly
  26.          where strona = '$strona'
  27.          and opublikowany is not null
  28.          order by opublikowany desc";
  29. }
  30. $wynik = $lacz->query($sql);
  31.  
  32. while ($artykul = $wynik->fetch_assoc())
  33. {
  34.  // nagłówek
  35.  echo "<h2>{$artykul['naglowek']}</h2>";
  36.  // obrazek
  37.  if ($artykul['obrazek'])
  38.  {
  39.    echo '<div style="float:right; margin:0px 0px 6px 6px;">';
  40.    echo '<img src="zmien_wielkosc_obrazka.php?obrazek=';
  41.    echo urlencode($artykul['obrazek']);
  42.    echo '&max_szerokosc=200&max_wysokosc=120" align=right/></div>';
  43.  }
  44.  
  45.  // treść
  46.   echo $artykul['tekst_artykulu'];
  47.    // podpis
  48.  echo "Dodał:";
  49.  $a = pobierz_rekord_autora($artykul['autor']);
  50.  echo '<br /><p>';
  51.  echo $a['pelne_nazwisko'].', ';
  52.  echo date('M d, H:i', $artykul['zmodyfikowany']);
  53.  echo '</p>';
  54. }
  55.  
  56. include('stopka.php');
  57. ?>

Co powinienem zrobić aby wyświetlić artykuł w ramce? Próbowałem ale nie dałem rady, więc zwróciłem się z prośbą do Was.

Ten post edytował Spawnm 3.07.2009, 21:45:10
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: 15.09.2025 - 04:38