I cant seem to be able to call eval() from my script... Do I have to do something special to make it happen? The error: Error Type: NameError Error Value: global name 'eval' is not defined the script: req=container.REQUEST if req.has_key(field_name): val = eval('req.'+field_name) if val != None: return val return '' TIA AM -- ================================================================== Aseem Mohanty Neurobehavioral Systems Inc, 828 San Pablo Ave, Albany, CA 94706 (R) 510 7696011 (M) 510 3014871 (O) 510 5279231 ================================================================== "I saw `cout' being shifted "Hello world" times to the left and stopped right there!!" -- Steve Gonedes ==================================================================
eval() is not save for TTW (through the web) programming. Generally one can make an external method and call it from TTW code. On Mon, 17 Jun 2002 03:38:28 -0700 Aseem Mohanty <aseem@neurobehavioralsystems.com> wrote:
req=container.REQUEST if req.has_key(field_name): val = eval('req.'+field_name) if val != None: return val return ''
use req.get(field_name), no need to use an unsafe eval. HTH, __Janko -- i.A. Dr. Janko Hauser Software Engineering c o m . u n i t G m b H online-schmiede seit 1994 http://www.comunit.de/ mailto:jh@comunit.de Eiffestr. 598 20537 Hamburg | Germany Fon 040 | 21 11 05 25 Fax 040 | 21 11 05 26
Janko Hauser wrote:
eval() is not save for TTW (through the web) programming. Generally one can make an external method and call it from TTW code.
Explaining to new users how to open gaping securiy holes in heir servers without warning them isn't nice ;-) cheers, Chris
participants (3)
-
Aseem Mohanty -
Chris Withers -
Janko Hauser