0

複数のドロップダウンを持つ HTML フォームがあり、送信時に空白のページが表示されます。別のフォームで動作させましたが、送信する値を追加すると、問題が発生し始めました。public-html からフォームを実行し、cgi-bin 内で cgi スクリプトを実行しています。これはかなり基本的なことだと思いますが、うまくいかないようです。以下は、基本的な CGI スクリプトとそれに続くフォームです。ご協力ありがとうございました。

#!/usr/bin/python

# Import modules for CGI handling 
import cgi, cgitb 

# Create instance of FieldStorage 
form = cgi.FieldStorage() 

# Get data from fields
if form.getvalue('select01'):
   tier = form.getvalue('select01')
else
   tier = "Please Select Tier"

if form.getvalue('select02'):
   version = form.getvalue('select02')
else
   version = "Please Select Version"

if form.getvalue('select03'):
   point = form.getvalue('select03')
else
   point = "Please Select Audit Point"

print "Content-type:text/html\r\n\r\n"
print "<html>"
print "<head>"
print "<title>Dropdown Demo</title>"
print "</head>"
print "<body>"
print "<h2> The Values Selected are %s, %s, %s </h2>" % (tier, version, point)
print "</body>"
print "</html>"

これがフォームです。長々と申し訳ありませんが、jquery を使用して 3 番目のドロップダウンをフィルタリングしていますが、スペースを節約するために含めていません。ご覧のとおり、3 つのドロップダウンがあり、送信時に 3 つの値すべてを cgi に投稿したいと考えています。

<section id="forms">

  <div class="row">
    <div class="span10 offset1">



      <form class="form-horizontal well" method="post" action="/cgi-bin/dropdown.py">
        <fieldset>
          <legend>Select Audit Point</legend>

          <div class="control-group">
            <label class="control-label" for="select01">Select Tier</label>
            <div class="controls">
              <select id="select01" name="select01">
                <option value="All Tiers">All Tiers</option>
                <option value="Database Tier">Database Tier</option>
                <option value="Application Tier">Application Tier</option>
                <option value="Web Tier">Web Tier</option>
              </select>
            </div>
          </div>

          <div class="control-group">
            <label class="control-label" for="select01">Select Version</label>
            <div class="controls">
              <select id="select02" name="select02">
                <option value="Oracle" name="Oracle">Oracle</option>
                <option value="SQL" name="SQL">SQL</option>
                <option value="Both" name="Both">Both</option>
              </select>
            </div>
          </div>

          <div class="control-group">
            <label class="control-label" for="select01">Select Audit Point</label>
            <div class="controls">
              <select id="select03" name="select03">
                <option value="Eagle Software Version">Eagle Software Version</option>
                <option value="Server OS, Memory, CPU">Server OS, Memory, CPU</option>
                <option value="High Availability">High Availability</option>
                <option value="DBMS Version">DBMS Version</option>
                <option value="DBMS Statistics">DBMS Statistics</option>
                <option value="DBMS Parameters">DBMS Parameters</option>
                <option value="DBMS Data File Growth">DBMS Data File Growth</option>
                <option value="Database Disk Structure">Database Disk Structure</option>
                <option value="Long Running SQL">Long Running SQL</option>
                <option value="Security Data Growth Range">Security Data Growth Range</option>
                <option value="Extraneous entries in System Tables">Extraneous entries in System Tables</option>
                <option value="Feed Error Orphans">Feed Error Orphans</option>
                <option value="Position Detail Orphans">Position Detail Orphans</option>
                <option value="Data Retention Policy">Data Retention Policy</option>
                <option value="Securities Added Daily">Securities Added Daily</option>
                <option value="Security Master Load">Security Master Load</option>
                <option value="SRM Purge">SRM Purge</option>
                <option value="Best Pricing Purge">Best Pricing Purge</option>
                <option value="Partitioning">Partitioning</option>
                <option value="DBMS Data/Log File Utilize Shared Disk">DBMS Data/Log File Utilize Shared Disk</option>
                <option value="DBMS Failover">DBMS Failover</option>
                <option value="DBMS Client Version">DBMS Client Version</option>
                <option value="Star Engine IP Configuration">Star Engine IP Configuration</option>
                <option value="Engine Count/Configuration">Engine Count/Configuration</option>
                <option value="STAR Engine Logging Interval">STAR Engine Logging Interval</option>
                <option value="PACE Engine Port Configuration">PACE Engine Port Configuration</option>
                <option value="PACE Server Logging">PACE Server Logging</option>
                <option value="PACE Engine Log Configuration">PACE Engine Log Configuration</option>
                <option value="STAR Engine Load Balancer Interval">STAR Engine Load Balancer Interval</option>
                <option value="Engines Restarted Weekly">Engines Restarted Weekly</option>
                <option value="Designated Master">Designated Master</option>
                <option value="Cluster Managers Identical">Cluster Managers Identical</option>
                <option value="Uploader Shared Disk Space">Uploader Shared Disk Space</option>
                <option value="Custom Archive Rule Shared Disk Space">Custom Archive Rule Shared Disk Space</option>
                <option value="App Server Clustering">App Server Clustering</option>
                <option value="PACE Event Concurrency">PACE Event Concurrency</option>
                <option value="Homogenous Engine Configuration">Homogenous Engine Configuration</option>
                <option value="Log Levels">Log Levels</option>
                <option value="Scheduler Purging">Scheduler Purging</option>
                <option value="Web Server Services Restarted Weekly">Web Server Services Restarted Weekly</option>
                <option value="Email Notification Basic Configuration">Email Notification Basic Configuration</option>
                <option value="Eagle Web Load Balancer Configuration"n>Eagle Web Load Balancer Configuration</option>
                <option value="Load Balancer Customizations">Load Balancer Customizations</option>
                <option value="Portal Shared Disk Space">Portal Shared Disk Space</option>
                <option value="Message Center Shared Disk Space">Message Center Shared Disk Space</option>
                <option value="Message Center ID'S">Message Center ID'S</option>
                <option value="Schedule Service Config">Schedule Service Config</option>
                <option value="ePace is a client of Clustered App Servers">ePace is a client of Clustered App Servers</option>
                <option value="Portal is a client of Clustered App Servers">Portal is a client of Clustered App Servers</option>
                <option value="ESTAR is a client of Clustered Load Balancers">ESTAR is a client of Clustered Load Balancers</option>
                <option value="ESTAR is a client of Clustered Engines">ESTAR is a client of Clustered Engines</option>
                <option value="ESTAR is a client of Clustered Report Export Services">ESTAR is a client of Clustered Report Export Services</option>
                <option value="WebSync Configured">WebSync Configured</option>
                <option value="Web Server Load Balancing Configured">Web Server Load Balancing Configured</option>
                <option value="Shared Disk Dynamic Folder">Shared Disk Dynamic Folder</option>

              </select>
            </div>
          </div>


          <div class="form-actions">
            <button type="submit" class="btn btn-primary" value="Submit">Submit</button>
            <button type="reset" class="btn">Cancel</button>
          </div>
        </fieldset>
      </form>
    </div>
  </div>

</section>
4

1 に答える 1