Re: [SMARTY] Smarty Validate
| From: | Vicente Werner | Date: | Sat, 23 Apr 2005 08:04:17 +0000 |
| Subject: | Re: [SMARTY] Smarty Validate | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12539@lists.php.net to get a copy of this message | ||
It could be a number of things, starting from different php version,
different extensions availible, different php configuration, etc...
Check that
On 4/23/05, Reynier Perez Mira <rperezm@estudiantes.uci.cu> wrote:
>
> Well list:
>
> Few weeks ago I begin use SmartyValidate and all it's ok. But I move my
> site to another server and I have some problems now. This is my code PHP:
>
> if(empty($_POST)) {
> SmartyValidate::connect($template, true);
>
> SmartyValidate::register_validator('username','uname','notEmpty',false);
>
> SmartyValidate::register_validator('useremail','umail','notEmpty',false);
>
> SmartyValidate::register_validator('useremail','umail','isEmail',false);
>
>
> SmartyValidate::register_validator('ucomments','ucomments','notEmpty',false);
> $template->display("guestbook_sign.tpl");
> }else{
> SmartyValidate::connect($template);
> if(SmartyValidate::is_valid($_POST)) {
> SmartyValidate::disconnect();
> $template->display('guestbook_show.tpl');
> }else{
> $template->assign($_POST);
> $template->display("guestbook_sign.tpl");
> }
>
> after I included all need library and initialize all vars. Something like
> this:
>
> require("./class/smarty/Smarty.class.php");
> require('./class/smarty/SmartyPaginate.class.php');
> require('class/smarty/SmartyValidate.class.php');
>
> $template = new Smarty();
>
> so this is part of my .tpl code in wich I try to validate some fields:
>
> ....
>
> <td>
> {validate id="ucomments" message="Debes introducir algún comentario antes
> de firmar el Libro"}
> <textarea name="ucomments" cols="55" rows="8"
> wrap="VIRTUAL"
> id="ucomments"></textarea>
> </td>
>
> ....
>
> The error appear in broswer is:
>
> Notice: Undefined offset: 1 in
> D:\WWW\jclub\class\smarty\SmartyValidate.class.php on line 417 (just at the
> top)
>
> Warning: Smarty error: validate: validator id 'ucomments' is not
> registered. in D:\WWW\jclub\class\smarty\Smarty.class.php on line 1088
> (after textarea)
>
> What's wrong? I not understand why if I move the site to another host and
> not touch anything of code and the order of folders is the same, how can
> pass this.
>
> Regards
>
> Reynier Pérez Mira
>
> 3ero. Ing. Informática
>
> Entre más inteligente me siento, más me doy cuenta de lo ignorante que
> soy.
>
>