Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    New to the CF scene
    Join Date
    Oct 2010
    Location
    Tallinn, Estonia
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Iframe content is not displaying correctly

    I have a page and the light blue area is actually an iframe. The source is a Python CGI script, which displays a table with some (pretty random) information.

    As you can see, the table itself works fine, but when I look at it on the main page within the iframe, all I see is some gibberish (hieroglyphs and the like).

    Any idea what might be causing this?

    Also, this is the view.py scripts source:

    Code:
    #!/usr/bin/python
    
    import cgi
    import cgitb
    import csv
    
    cgitb.enable()
    f = open("players.csv", "r")
    print "Content-type: text/html"
    print
    print "<table border=\"1\" cellpadding=\"5px\" width=\"500\" style=\"margin-left:auto;margin-right:auto\">"
    print "<th>Nimi</th><th>Email</th><th>Panus</th><th>M2ng</th>"
    for line in f:
    	x = line.find(",",0,len(line))
    	print "<tr><td>" + line[0:x] + "</td>"
    	y = line.find(",",x+1,len(line))
    	print "<td>" + line[x+1:y] + "</td>"
    	print "<td>" + line[y+1:len(line)] + "</td>"
    	print "<td><input type=\"button\" value=\"Alusta\"></td></th>"
    print "</table>"
    EDIT: I now realize this might have been better suited for the CGI forum, sorry.
    Last edited by oliverb4ss; 11-16-2010 at 05:15 PM.


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •