|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
eadz Smarty Regular
Joined: 30 Apr 2003 Posts: 61 Location: Auckland, New Zealand
|
Posted: Fri Mar 04, 2005 4:42 am Post subject: Smarty validate without assign($_POST) |
|
|
Hi,
SmartyValidate rocks!
One thing, is that you do $smarty->assign($_POST), which is kind of like global varibles... assigning all post varibles to a template.
This USUALLY won't cause a problem, but I can see an issue ( for example ) if you check for {if $submitted_ok} and then provide a download link, but if someone posts 'submitted_ok' in a post, then the form will go through.
I like to have controll of the varibles assigned to the template.
When you use smarty validate, you give it the names of the form fields, so is there a way for Smarty validate to use this infomation and only assign fields that need validating? E.g. SmartyValidate->assign() will assign only fields that are to be validated? _________________ bBlog - Smarty based blogging software
I work for Webforce web site design ( Auckland, NZ ) |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Mar 04, 2005 5:05 am Post subject: |
|
|
encapsulate your post vars:
[php:1:972dcc3326]$smarty->assign('post',$_POST);[/php:1:972dcc3326]
|
|
Back to top |
|
eadz Smarty Regular
Joined: 30 Apr 2003 Posts: 61 Location: Auckland, New Zealand
|
Posted: Fri Mar 04, 2005 5:06 am Post subject: |
|
|
mohrt wrote: | encapsulate your post vars:
[php:1:51b9f9820b]$smarty->assign('post',$_POST);[/php:1:51b9f9820b]
|
Will smarty validate still work if I do that? _________________ bBlog - Smarty based blogging software
I work for Webforce web site design ( Auckland, NZ ) |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Fri Mar 04, 2005 5:14 am Post subject: |
|
|
sure it will, just use $post.var instead of $var in the templates. |
|
Back to top |
|
|
|
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
|