#! /usr/bin/python

import cgi
import cgitb
cgitb.enable()

form = cgi.FieldStorage()
HOME = form.getfirst("Home", "")
FILE = form.getfirst("File", "/home/atriumtech/index.html")

if not (FILE.startswith('/home2/')):
    txt = ""
else:
    try:
        txt = file(FILE).read()
    except:
        txt = ""

print "Content-Type: text/html"     # HTML is following
print                               # blank line, end of headers

print '<BASE HREF="%s">' % FILE[FILE.find("http"):].replace("http/","http://")

print txt
