#!/usr/bin/python

import cgi
from navi import *

fields = cgi.FieldStorage()
title = "Hello Baby"

print "Content-Type: text/html\n\n"
print "<!DOCTYPE html>"
print "<html>"

print "<head>"
print "<title>", title, "</title>"
print "<link href=\"/css/basic.css\" rel=\"stylesheet\" type=\"text/css\">"
print "<meta charset=\"UTF-8\">"
print "</head>"

print "<body>"

for k in fields.keys():
	print k, fields[k].value

print "</body>"
print "</html>"


#!/usr/bin/python

import cgi
from navi import *

fields = cgi.FieldStorage()
title = "Hello Baby"

def reply():

    ret = ""

    ret += "Content-Type: text/html\n\n"
    ret += "<!DOCTYPE html>"
    ret += "<html>"

    ret += default_head(title)
    ret += default_navigator()

    ret += "<body>"
    ret += "<div class=\"content\">"

    for k in fields.keys():
	    ret += "<div>" + k + " => " + fields[k].value + "</div>"

    ret += "</div>"
    ret += "</body>"
    ret += "</html>"

    print ret

reply()

add default head add default navigator