Re: [SMARTY] form and cache
| From: | Elgi | Date: | Sun, 23 Mar 2003 12:05:29 +0000 |
| Subject: | Re: [SMARTY] form and cache | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8844@lists.php.net to get a copy of this message | ||
Hello Elgi,
little error, my code isn't form.tpl but form.php !
--
Cordialement,
Elgi
Le dimanche 23 mars 2003 à 12:57:24, vous écriviez :
E> Hello smarty-general,
E> I have a form with a antiflood
E> what i do made for caching the form ?
E> form's var don't change allways but it's possible flood
form.php :
E> if (isset($_POST[var])) {
E> $time=time()+60;
E> $timeflood=time();
E> $queryflood="select time from flood where ip='$REMOTE_ADDR' and
time>='$timeflood'";
E> $resflood=@mysql_query($queryflood, $db_link);
E> @mysql_close();
E> $rowflood=@mysql_fetch_row($resflood);
E> $sqltime=$rowflood[0];
E> if ($sqltime>=$timeflood) {
E> $sec=$sqltime-$timeflood;
E> $smarty->assign('flood_d',...
E> $smarty->assign('sec',$sec);
E> $smarty->assign('flood_f',...
E> } else {
E> if ($_POST[var]=="") {
E> $smarty->assign('error',...
E> } else {
E> ...
E> @mail($dest,$sujet,$mes,$mail_header,$option);
E> @mysql_query("insert into flood (ip, time) values ('$REMOTE_ADDR',
'$time')", $db_link);
E> $smarty->assign('form_ok',...
E> }
E> }
E> }
E> //this is static assign
E> $smarty->config_load('smarty.conf');
E> $smarty->assign....
E> $smarty->assign....
E> $smarty->assign....
E> $smarty->display('form.tpl');
E> --
E> Cordialement,
E> Elgi