Jun-11-2017, 03:05 AM
Im doing a front and back end project which will be run on apache 2.4.7
So far however, my backend, when requested by the front end, returns an error. Pls send help.
FRONT END:
<!DOCTYPE html>
<html>
<head>
<title>SAT College Board 2010 School Level Results</title>
</head>
<body>
SAT SCHOOL LEVEL RESULTS !!! <br>
<form action = "Backend.py">
What is the name of the school whose results you wish to view?
<input type = "text" name = "school"> <br>
What is the District Number?
<input type = "number" name = "dn"> <br>
<input type = "submit" name = "doThis" value = "Submit Form">
</form>
</body>
</html>
BACK END:
So far however, my backend, when requested by the front end, returns an error. Pls send help.
FRONT END:
<!DOCTYPE html>
<html>
<head>
<title>SAT College Board 2010 School Level Results</title>
</head>
<body>
SAT SCHOOL LEVEL RESULTS !!! <br>
<form action = "Backend.py">
What is the name of the school whose results you wish to view?
<input type = "text" name = "school"> <br>
What is the District Number?
<input type = "number" name = "dn"> <br>
<input type = "submit" name = "doThis" value = "Submit Form">
</form>
</body>
</html>
BACK END:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
#! /usr/bin/python print 'content-type: text/html \n' import cgitb cgitb.enable() import cgi fs = cgi.FieldStorage() import csv DB = open ( 'SAT_School_Participation_and_Performance__2012-2013.csv' , 'rb' ) readerObject = csv.reader( DB) for record in readerObject: account = line.split( "," ) if record.append(account[ 0 ]) = data[ "school" ].value return record if record.append(account[ 1 ]) = fs[ "dn" ].value return record DB.close() |