Re: [SMARTY] Using $HTTP_POST_VARS for $smarty.post...
| From: | Paul Lockaby | Date: | Tue, 11 Mar 2003 17:12:13 +0000 |
| Subject: | Re: [SMARTY] Using $HTTP_POST_VARS for $smarty.post... | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8561@lists.php.net to get a copy of this message | ||
Ronny 'Ronino' Multrus wrote:
Hello, I needed to manipulate the data in $_POST (e.g. $_POST['var'] .= ".ext") and wondered why $smarty.post didn't recognize the changes still printing the old value. A short look at Smarty's code revealed that the $HTTP_*_VARS-arrays are used for Smarty's request variables. But these $HTTP_*_VARS are deprecated according to the php doc and shouldn't be used any longer. Simply changing them to $_*'s in Smarty.class.php didn't work, $GLOBALS['HTTP_POST_VARS'] is still used in the compiled template. Now I got a problem because I use $_POST etc. everywhere in my scripts. What do you guys think about that? RoninoI noticed this, too. However, Smarty is designed to work with php 4.0.6 and newer and thus using the $_POST vars would require 4.1.0 and higher. I did do some testing on this point and noticed some inconsistencies. I assigned a variable to $_POST and noticed that it didn't appear in $HTTP_POST_VARS and vice versa, but when I assign something to $_SESSION, it immediately appears in $HTTP_SESSION_VARS. I'm not sure what the cause of this inconsistency is. Of course, changing the code to reference $_POST instead of $HTTP_POST_VARS would break applications that assigned variables into $HTTP_POST_VARS. It's six to one, half a dozen to the other. Anyone else have any thoughts? ~Paul