Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [inne][SMARTY] Zapytanie
gOdi_1991
post
Post #1





Grupa: Zarejestrowani
Postów: 33
Pomógł: 0
Dołączył: 5.05.2010

Ostrzeżenie: (30%)
XX---


Witam mam dziwny problem nie przekazuje mi zmiennej do pliku tpl

plik php
  1. <?php
  2.  
  3.  
  4. require 'libs/Smarty.class.php';
  5. require_once ('cfg.php');
  6.  
  7. $smarty = new Smarty;
  8.  
  9.  
  10.  
  11. $sql = mysql_query("SELECT id, title, value_1 FROM news");
  12.  
  13. $row = mysql_fetch_array($sql))
  14.  
  15. $id = $row['id'];
  16.  
  17. $smarty->assign('id', $id);
  18.  
  19. $smarty->display('news.tpl');
  20.  
  21.  
  22.  
  23.  
  24. ?>


plik .tpl
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <title>Aktualnosci</title>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6.  
  7. <link href="templates/style.css" rel="stylesheet" type="text/css" />
  8. </head>
  9. <body> Numer id:{$id}
  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: 2.10.2025 - 14:31