Page 3 of 3 First 123
  • Jump to page:
    #31
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    36
    Rep Power
    11
    K now im stuck trying to put it in html....
    Here's what i have..

    Code:
     print "Content-type: text/html"
    print
    print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'
    print '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">'
    import gradelist
    data = gradelist.read()
    import cgi
    form = cgi.FieldStorage()
    print "<head>"
    print "<title>Grade Manager</title>"
    print "</head>"
    print "<body>"
    print "<h1>Grade Manager</h1>"
    x = form['password'].value
    if x == '165':
        for entry in data:
            print ("<p>" + entry[0] + "</p>")
    else: 
        print "Wrong Password"
    print "</body>"
    print "</html>"
    when i type in 165 for pw, i dont get any of the entries... but when i type in a wrong pw, i get "wrong password" ... what's wrong? how come it wont show on html...?
  2. #32
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2004
    Posts
    36
    Rep Power
    11
    Hmmm updated problem....

    my code:
    Code:
     print "Content-type: text/html"
    print
    print '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">'
    print '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">'
    import gradelist
    data = gradelist.read()
    import cgi
    form = cgi.FieldStorage()
    print "<head>"
    print "<title>Grade Manager</title>"
    print "</head>"
    print "<body>"
    print "<h1>Grade Manager</h1>"
    x = form['password'].value
    if x == '165':
        for entry in data:
            print "<li><p>" + entry[0] + ":" + entry[1] + "</p>"
            print "<p>" + entry[2] + "</p></li>"
    else: 
        print "Wrong Password"
    print "</body>"
    print "</html>"
    when i type in 165 for password i got this script error:

    Script Error

    There was an error with your script and it didn't exit properly.

    This was its output:

    Content-type: text/html

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    Traceback (most recent call last):
    File "/home/jju/public_html/viewall.py", line 6, in ?
    data = gradelist.read()
    File "/home/jju/public_html/gradelist.py", line 40, in read
    gradelist = pickle.load(fh)
    File "/usr/local/stow/python-2.3.3/lib/python2.3/pickle.py", line 1390, in load
    return Unpickler(file).load()
    File "/usr/local/stow/python-2.3.3/lib/python2.3/pickle.py", line 872, in load
    dispatch[key](self)
    File "/usr/local/stow/python-2.3.3/lib/python2.3/pickle.py", line 980, in load_string
    raise ValueError, "insecure string pickle"
    ValueError: insecure string pickle

    Anyone know what's wrong? i uploaded the grada data file and that's the error i got...
Page 3 of 3 First 123
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo