CGI / Frames question

Sandy Norton sandskyfly at hotmail.com
Sun Aug 18 14:57:28 CEST 2002


Hi folks,

I have an  html frameset with two sections: a top section (where I put
content) and a bottom section (which is like a control bar).

I've set up a python cgi script which dispatches commands from the
control frame and shows the results in the content frame. 

It just occured to me to collect some simple information from the
content  frame, but I don't have any idea how to pass that information
to the script.

Here's some simplified code which illustrates the problem:


frame.html
-------------
<frameset rows="*,45" frameborder="NO" border="0" framespacing="0"
cols="*">
  <frame name="mainFrame" src="content.html">
  <frame name="bottomFrame" scrolling="NO" noresize
src="control.html">
</frameset>


content.html
------------
<form action="cgi-bin/testcgi.py" method="get" name="news_list">
      <input type='checkbox' name='news_article' value="a">
	     <a href='http://www.news.com/story1.html'>article 1</a>
      <input type="submit" name="submit_a" value="submit_a">
</form>


control.html
------------
<form name="control" method="get" action="cgi-bin/testcgi.py"
target="mainFrame">
      <input type="submit" name="submit_b" value="submit_b">
</form>


cgi-bin/testcgi.py
-----------
#!python

import cgi, cgitb; cgitb.enable()
print "Content-Type: text/plain\n\n"
form = cgi.FieldStorage()
for name in form.keys():
    print "Input: " + name + " --> " + form[name].value + "\n"
print "Finished!"

server.py
---------
from CGIHTTPServer import test as serve
if __name__=='__main__': serve()


What I specifically would like to do is have the user click on
'submit_b' from the control frame (control.html) and pass on the
differences in state from _both frames_ to the python cgi script. It
would be as if both 'submit_a' and 'submit_b' were somehow pressed
simultaneously.

Is this possible?

Any help would be much appreciated,


regards,

Sandy



More information about the Python-list mailing list