Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #11670
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.013 |
| X-Spam-Evidence | '*H*': 0.97; '*S*': 0.00; 'assign': 0.04; 'decent': 0.07; 'variables.': 0.09; 'am,': 0.12; 'skip:[ 20': 0.12; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'subject:values': 0.16; 'url:manual': 0.16; 'this:': 0.16; 'wrote:': 0.16; 'wed,': 0.17; 'header:In-Reply-To:1': 0.22; 'variable': 0.24; 'aug': 0.24; 'separate': 0.28; 'message- id:@mail.gmail.com': 0.29; 'construct': 0.30; 'none,': 0.30; 'chris': 0.32; 'list': 0.32; 'probably': 0.33; 'to:addr:python- list': 0.33; '17,': 0.34; 'explicit': 0.34; 'object': 0.35; 'data.': 0.36; 'but': 0.37; 'some': 0.38; 'received:google.com': 0.38; 'received:209.85': 0.38; 'subject:: ': 0.39; 'php': 0.39; 'url:en': 0.39; 'to:addr:python.org': 0.39; 'url:net': 0.60; 'kind': 0.61; 'power': 0.63; 'learned': 0.73; 'url:php': 0.83 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=XfXWa77tJJ1o8HB5IVyXv7Was4LZP+W+XnlIePs4YEI=; b=lZPnXunr1wch5cywAZ/sV8bLEi2pjrDvhzet+nKaKCJkzbwUB4cgL2xq0rRFjd5D1A I/2ONE4uugMC0rOZCiH+TdcpZorkvam28Gbvjy33bjKAGc+B884HZ+kGp1GUYaqZ+wt1 siWA+6i0PPqDq4WQKrsQdM0eRYBW0S1WdMQnI= |
| MIME-Version | 1.0 |
| In-Reply-To | <92d066ff-d0ee-432f-b512-1f2fa01ba681@a12g2000yqi.googlegroups.com> |
| References | <92d066ff-d0ee-432f-b512-1f2fa01ba681@a12g2000yqi.googlegroups.com> |
| Date | Wed, 17 Aug 2011 10:25:03 +0100 |
| Subject | Re: CGI: Assign FieldStorage values to variables |
| From | Chris Angelico <rosuav@gmail.com> |
| To | python-list@python.org |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.12 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.121.1313573106.27778.python-list@python.org> (permalink) |
| Lines | 18 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1313573106 news.xs4all.nl 23900 [2001:888:2000:d::a6]:48914 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:11670 |
Show key headers only | View raw
On Wed, Aug 17, 2011 at 10:06 AM, Gnarlodious <gnarlodious@gmail.com> wrote:
> I get a construct like this:
>
> form=FieldStorage(None, None, [MiniFieldStorage('name1', 'Val1'),
> MiniFieldStorage('name2', 'Val2'), MiniFieldStorage('name3', 'Val3')])
>
> when I need to assign the variable name2 the value Val2
You can probably do this with some kind of list comprehension, but I
recommend against it, if this has come from a web form. You do NOT
want end users having the power to set variables. Keep it in a
separate object (such as 'form') such that you must always be explicit
about fetching form data. PHP has learned the risks; here's a decent
summary:
http://www.php.net/manual/en/security.globals.php
Chris Angelico
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
CGI: Assign FieldStorage values to variables Gnarlodious <gnarlodious@gmail.com> - 2011-08-17 02:06 -0700
Re: CGI: Assign FieldStorage values to variables Gnarlodious <gnarlodious@gmail.com> - 2011-08-17 02:19 -0700
Re: CGI: Assign FieldStorage values to variables Chris Angelico <rosuav@gmail.com> - 2011-08-17 10:41 +0100
Re: CGI: Assign FieldStorage values to variables Chris Rebert <clp2@rebertia.com> - 2011-08-17 09:23 -0700
Re: CGI: Assign FieldStorage values to variables Chris Angelico <rosuav@gmail.com> - 2011-08-17 10:25 +0100
Re: CGI: Assign FieldStorage values to variables Gnarlodious <gnarlodious@gmail.com> - 2011-08-17 20:52 -0700
Re: CGI: Assign FieldStorage values to variables Gnarlodious <gnarlodious@gmail.com> - 2011-08-17 02:20 -0700
Re: CGI: Assign FieldStorage values to variables Nobody <nobody@nowhere.com> - 2011-08-17 13:45 +0100
csiph-web