passing values from one form to another

Discussion in 'Python' started by eight02645999@yahoo.com, Nov 12, 2005.

  1. Guest

    hi

    i have 3 python cgi scripts created, one is a login page(login.py),
    another is the main page(main.py) with a lot of user inputs and the
    last one is a python cgi script results.py to process main.py

    In main.py, i am able to check for the value of the user and password
    field, eg

    if form.has_key("user") and form["button"].value == "Login" and
    form.has_key("password"):
    # show all fields

    how can i also check for the user field in the results.py script? ie ,
    pass the value of the "user" to the python script..so that user must
    always login to get to results.py....

    thanks..
     
    , Nov 12, 2005
    #1
    1. Advertising

  2. wrote:
    > hi
    >
    > i have 3 python cgi scripts created, one is a login page(login.py),
    > another is the main page(main.py) with a lot of user inputs and the
    > last one is a python cgi script results.py to process main.py
    >
    > In main.py, i am able to check for the value of the user and password
    > field, eg
    >
    > if form.has_key("user") and form["button"].value == "Login" and
    > form.has_key("password"):
    > # show all fields
    >
    > how can i also check for the user field in the results.py script? ie ,
    > pass the value of the "user" to the python script..so that user must
    > always login to get to results.py....


    Use a session. Or pass the values as hidden form-fields, which gets
    pretty tedious.

    Diez
     
    Diez B. Roggisch, Nov 12, 2005
    #2
    1. Advertising

  3. Mike Meyer Guest

    writes:
    > In main.py, i am able to check for the value of the user and password
    > field, eg
    >
    > if form.has_key("user") and form["button"].value == "Login" and
    > form.has_key("password"):
    > # show all fields
    >
    > how can i also check for the user field in the results.py script? ie ,
    > pass the value of the "user" to the python script..so that user must
    > always login to get to results.py....


    This isn't really a Python question. The canonical solution is to set
    a cookie to get the browser to pass the required information to the
    next form.

    <mike
    --
    Mike Meyer <> http://www.mired.org/home/mwm/
    Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
     
    Mike Meyer, Nov 12, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?Q2hyaXM=?=

    Error passing values from one pahge to another

    =?Utf-8?B?Q2hyaXM=?=, May 13, 2005, in forum: ASP .Net
    Replies:
    8
    Views:
    1,074
    =?Utf-8?B?Q2hyaXM=?=
    May 16, 2005
  2. Replies:
    5
    Views:
    801
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
    Jun 12, 2007
  3. Rob R. Ainscough
    Replies:
    3
    Views:
    372
    Rob R. Ainscough
    Jun 14, 2005
  4. Robert Cohen
    Replies:
    3
    Views:
    302
    Andrew Durstewitz
    Jul 15, 2003
  5. DanC
    Replies:
    2
    Views:
    141
Loading...

Share This Page