Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Python HTML data passing

Status
Not open for further replies.

question0mark

Programmer
Jan 29, 2005
1
US
Hello all. I am very new to python, and to programming in general. However, I have a master's degree that depends on the success of this project, and am confused as to how to get it working.

I am creating a website to process data from user-uploaded files.

The basic sense of it all is that a user enters their U/N, password, and the location of the file, with a few other factors (filetype, usergroup...). This file is then uploadewd to a MySQL database as a longtext field. This part is written in PHP. I would like it to redirect to a python script for calculation, but i don't know how to even begin doing it. If someone could help me to understand how to pass data between HTML field, or PHP global vars (like $HTML_POST_VARS) and a python script, that would be greatly appreciated.

-?
 
Look in the manual for the 'cgi' module.
Code:
import cgi

form = cgi.FieldStorage()

for key in form.keys():
  print "%s = %s" % ( key, form[ key ] )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top