我想要有两个不同的提交按钮。如果一个提交按钮被按下,那么它将转到一个cgi脚本,如果另一个按钮被转到另一个。现在下面是我的代码,但它不工作,因为我想要它。无论按下哪一个脚本,它们都只能使用相同的脚本。两个不同的提交按钮html/cgi表格
#!/usr/bin/env python
import cgi
import cgitb
cgitb.enable()
form = cgi.FieldStorage()
keyword = form.getvalue('keyword')
keyset = set(x.strip() for x in open('keywords.txt', 'r'))
print 'Content-type: text/html\r\n\r'
print ''
print "Set = ", keyset
print '
If your keyword is in the set, use this submission button to retrieve recent tweets
'print '
'print 'Keyword:
'
print ''
print ''
print 'Content-type: text/html\r\n\r'
print ''
print '
If your desired keyword is not in the set, use this submission button to add it
'print '
'print 'Keyword:
'
print ''
print ''