简体   繁体   中英

How to pass local variables from one cgi to another cgi in python

I have a cgi webpage that I wrote using python. This page takes input from the user and directs him to another page. In the first page I am using local variables that I would like to send to the second page. Since these variables are not user input, they cannot be retrieved using form = cgi.FieldStorage(). So my question is, how do I retrieve variables (that were not inserted by the user) from the previous cgi page?

An HTML form can store hidden values.

Eg,

<input type="hidden" name="example" value="data1">

That input tag will not be visible on the Web page, but when the form is submitted your cgi script will receive a field named example that contains data1 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM