tags:

views:

160

answers:

2

I have some old php code that has been working happily. I need to do some updating and have moved the code to another machine. Everything is fine except this smarty code no longer works.

{$smarty.get.myvar}

I know it must be to do with differnt config settings but i can't figure it out. Register_Globals is off on both installations.

+1  A: 

Toby,

the documentation for the "global" variables is here http://www.smarty.net/manual/en/language.variables.smarty.php
Make sure you have request_vars_order and request_use_auto_globals configured to your needs, but the syntax $smarty.get.myvar is completely fine.

Make sure the case is correct and you are not sending $smarty.get.myVar...

michal kralik
A: 

This is a BAD way of working with request variables. Template should never fetch the variables directly from GPC vars. Variables should be validated by script, sanitized and then ->assigned to a template.

FractalizeR