-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathwebcgi_app
More file actions
31 lines (26 loc) · 747 Bytes
/
webcgi_app
File metadata and controls
31 lines (26 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/python
## reference http://www.tutorialspoint.com/python/python_cgi_programming.htm
import cgi,cgitb
import sys
print "Content-Type: text/html; charset=utf-8\n\n";
allcos = open("cos.txt", 'r')
#mas = input("Enter model: ")
#mas1 = input("Service Type: ")
form = cgi.FieldStorage()
mas =form.getvalue('mas')
mas1 =form.getvalue('mas1')
print "Content-type:text/html\r\n\r\n"
print "<html>"
print "<head>"
print "<title>Hello - Second CGI Program</title>"
print "</head>"
print "<body>"
print "<h2>Hello %s %s</h2>" % (mas, mas1)
print "</body>"
print "</html>"
for line in allcos:
# line = str(line)
if form.getvalue('mas') in line and form.getvalue('mas1') in line:
print"%s" % line
print
allcos.close()