Hi, I have a very simple problem yet I can't find out how to do it for the life of me. I am creating a simple CGI script with Python and part of it needs a HTML form. This is what I have so far (excludes imports, etc):

font_size = 9

print "<form name='input' action='Player.py' method='get'>"
print "Set Volume: <input type='text' name='volume' />"
print "<input type='submit' value='Submit' />"
print "</form>"

I would like to pass my 'font_size' variable along with the form submission so that my next script knows what font size to use.

How can I do this?

Thanks in advance.

INPUT tag has a variety of types. One is hidden: http://www.htmlhelp.com/reference/wilbur/form/input.html

Allows you to embed information in the form which you do not want changed. This can be useful if the document is generated by a script and you need to store state information. NAME and VALUE of this input field will be sent to the server without modifications.

Brilliant! I didn't think of just creating a hidden input tag. That will work perfectly. Problem solved.

Thank you.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.