import cgi, urllib, string form = cgi.FieldStorage() print """Content-type: text/html URI Display

URI Display

""" page = urllib.urlopen(form["uri"].value) if string.find(page.info()['Content-type'], "text/html") == 0: print "
" for line in page.readlines(): line = string.replace(line, "&", "&") line = string.replace(line, "<", "<") line = string.replace(line, ">", ">") line = string.replace(line, "\n", "
") print line print "
" else: print "

Sorry, not an HTML file.

" print """
"""