Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
unexpected T_VARIABLE

 
Post new topic   Reply to topic    Smarty Forum Index -> Language: Polish
View previous topic :: View next topic  
Author Message
znyk
Smarty n00b


Joined: 22 Nov 2009
Posts: 4

PostPosted: Wed Jan 13, 2010 12:20 pm    Post subject: unexpected T_VARIABLE Reply with quote

Kod jest taki:
Code:

1.<?php
2.require_once('Smarty-2.6.26/libs/Smarty.class.php');
3.$smarty= new Smarty();
4.$smarty->template_dir='./templates/';
5.$smarty->compile_dir='./templates/compile/';
6.$smarty->cache_dir='./templates/cache/';
7.$smarty->caching=false;
8.$smarty->error_reporting=E_All;
9.
10.
11.if(isset($_GET['page']))
12.{
13.  $page=htmlentities($_GET['page']);
14.}
15else
16.{
17.   $page='glowna';
18.}
19.
20.$tytul='Katalog produktow';
21.$opis='katalog produktów spożywczych';
22.
23.$menu=menu('./produkty');
24.$smarty->assign('menu', $menu);
25.$smarty->assign('page', $page);
26.$smarty->assign('tytul', $tytul);
27.$smarty->assign('opis', $opis);
28.$smarty->display('index.tpl');
29.
30.function menu($katalog)
31.{
32.if($uchwyt=opendir($katalog))
33.   {
34.       while($plik=readdir($uchwyt))
35.      {
36.           if($plik=='.' || $plik=='..')
37.         {
38.            continue;
39.         }
40.            if(is_dir($katalog.'/'.$plik))
41.          {
42.             if($nazwa=file($katalog.'/'.$plik.'/info.txt'))
43.            {
44.                $pliki[]=$nazwa[0];
45               $pliki[]=menu($katalog.'/'$plik);
46.            }
47.          }
48.      }
49. 
50.   }
51.   return $pliki;
52.}
53.
54.?>


Błąd zaś :
Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\index.php on line 45

Co jest nie tak ?
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Language: Polish All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP