Ejemplo n.º 1
0
#!/usr/bin/env python

import cgi
import cgitb
import test

cgitb.enable()

print "Content-type: text/html\n\n"

form=cgi.FieldStorage()

devices = test.getdevices()
print "<form action=\"/cgi-bin/examples/checkbox.py\" method=\"POST\">"

for dev in devices:

    if dev not in form:
        print dev + " is not checked"
        test.addcheckbox(dev, False)

    else:
        print dev + " is checked"
	test.addcheckbox(dev, True)
        


print "<input type=\"submit\" value=\"Submit\" name=\"submit\">"  
print "</form>"
	
	
Ejemplo n.º 2
0
import cgi
import cgitb
import test

cgitb.enable()

print "Content-type: text/html\n\n"

form=cgi.FieldStorage()

var1 = "setting"

if var1 not in form:
    print "<h1>The box was not checked</h1>"
    print test.returntext()
    devicelist = test.getdevices()
    print devicelist[0]
    print devicelist[1]

else:
    text=form[var1].value
    print "<h1>The check box was ticked:</h1>" 
	
#print "<form action=\"/cgi-bin/examples/checkbox.py\" method=\"POST\">"
    devices=test.getdevices()
    for item in devices:
		test.addcheckbox(item)
    print "<input type=\"submit\" value=\"Submit\" name=\"submit\">"  
	#print "</form>"
	
	
Ejemplo n.º 3
0
import cgi
import cgitb
import test

cgitb.enable()

print "Content-type: text/html\n\n"

form = cgi.FieldStorage()

var1 = "setting"

if var1 not in form:
    print "<h1>The box was not checked</h1>"
    print test.returntext()
    devicelist = test.getdevices()
    print devicelist[0]
    print devicelist[1]

else:
    text = form[var1].value
    print "<h1>The check box was ticked:</h1>"

    #print "<form action=\"/cgi-bin/examples/checkbox.py\" method=\"POST\">"
    devices = test.getdevices()
    for item in devices:
        test.addcheckbox(item)
    print "<input type=\"submit\" value=\"Submit\" name=\"submit\">"
#print "</form>"

#if request.POST.get('submit'):
Ejemplo n.º 4
0
#!/usr/bin/env python

import cgi
import cgitb
import test

cgitb.enable()

print "Content-type: text/html\n\n"

form = cgi.FieldStorage()

devices = test.getdevices()
print "<form action=\"/cgi-bin/examples/checkbox.py\" method=\"POST\">"

for dev in devices:

    if dev not in form:
        print dev + " is not checked"
        test.addcheckbox(dev, False)

    else:
        print dev + " is checked"
        test.addcheckbox(dev, True)

print "<input type=\"submit\" value=\"Submit\" name=\"submit\">"
print "</form>"

#if request.POST.get('submit'):
#	print "Submit was pressed"
#else :