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.

Recommended Answers

All 2 Replies

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

TYPE=hidden
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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.