Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> SMARTY -> jak dodać problem z formularzem
freko
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 14.04.2006

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


Chciałem rozbudować nieco formularz na stronie, poprzez dodanie do niego jeszcze kilku opcji w postaci poniźszego kodu:
Kod
<?php
include_once('configuration.php');
include_once(SMARTY_CLS_DIR.'Smarty.class.php');

$smarty=new Smarty;
$smarty->template_dir=SMARTY_TPL_DIR;
$smarty->cache_dir=SMARTY_CACHE_DIR;
$smarty->compile_dir=SMARTY_COMPILE_DIR;
...
$smarty->assign('study_visit', $_POST['study_visit']);
$smarty->assign('theatrical_sumr', $_POST['theatrical_sum']);
...
(w pliku formindex.php)
przy czym configuration.php:
Kod
<?php
define('SMARTY_CLS_DIR', '/usr/local/share/smarty/');
define('SMARTY_TPL_DIR', '/home/pllai/public_html/inc/en/templates/tpl/');
define('SMARTY_CACHE_DIR', '/home/pllai/public_html/inc/en/templates/cache/');
define('SMARTY_COMPILE_DIR', '/home/pllai/public_html/inc/en/templates/compile/');

?>
...


natomiast w pliku formindex.tpl kod wygląda tak:
Kod
<input type="text" name="study_visit" value="{$smarty.post.study_visit}" />
<input type="text" name="theatrical_sum" value="{$smarty.post.theatrical_sum}" />


Niestety problem polega na tym ze nie chce mi dodać tych 2 pól do '/home/pllai/public_html/inc/en/templates/compile/')

Wszystko przebiegłoby bez problemów, lecz nie mam dostępu do Smarty (do /usr/local/share/smarty/) (nie moge dodawać kodu do definicji szablonów), a wydaje mi się że tutaj tylko tego brakuje, ktoś może wie jak sie za to zabrać ?
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
anopak
post
Post #2





Grupa: Zarejestrowani
Postów: 124
Pomógł: 0
Dołączył: 26.10.2004
Skąd: Rybnik

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


Cytat(freko @ 2006-04-14 21:25:28)
Kod
<?php
...
$smarty->assign('study_visit', $_POST['study_visit']);
$smarty->assign('theatrical_sumr', $_POST['theatrical_sum']);
...


(...)

Kod
<input type="text" name="study_visit" value="{$smarty.post.study_visit}" />
<input type="text" name="theatrical_sum" value="{$smarty.post.theatrical_sum}" />

mam jedno pytanie, po co dajesz assign 'study_visit' $_POST['study_visit'] skoro i tak w formularz następnie korzystasz z smarty.post.study_visit (IMG:http://forum.php.pl/style_emoticons/default/questionmark.gif)
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: 4.10.2025 - 16:58