form processing question

WmGill wmgill at wmgill.com
Mon Nov 3 11:02:46 EST 2003


> You probably will be happier if you use something other than CGI,...
I thought the cgi interface was the standard for HTML form processing?

> I believe os.environ()['SCRIPT_NAME'] should give you what you want...
I don't see where knowing the script name helps?

Others have also suggested using other programs.  I obviously need to be
more clear in what I thought was a simple question.

Lets say I have a simple html form that asks for: First Name, Last Name,
department, Employee ID, and comments.  An emplyee fills out the form,and
clicks submit.  My script looks up the employee ID and doesn't find him/her,
so it returns (displays) the form for correction, but leaving all the
submitted information in the original input fields so that the employee
doesn't have to re-enter everything.  I know how to do this in PHP, but want
to try it in Python.

Bill



"Ian Bicking" <ianb at colorstudy.com> wrote in message
news:mailman.352.1067818417.702.python-list at python.org...
> On Nov 2, 2003, at 4:41 PM, WmGill wrote:
> > I am experimenting with Python, and want to convert some of my PHP
> > scripts
> > to python cgi scripts.  In PHP I use  PHP_SELF for the action target.
> > This
> > way I can "reuse" data in fields (i.e. if the user enters data in a
> > field
> > then submits the form,  it comes back already filled in on each
> > subsequent
> > iteration).  I know I can do this in Python, but before I spend a lot
> > of
> > time, is it very complicated, or can form field values be
> > (re-)populated
> > easily?
>
> You probably will be happier if you use something other than CGI, but
> for CGI I believe os.environ()['SCRIPT_NAME'] should give you what you
> want.  (This URL introspection differs considerably between frameworks)
>
> --
> Ian Bicking | ianb at colorstudy.com | http://blog.ianbicking.org
>
>






More information about the Python-list mailing list