module Main where

import Network.CGI
import Data.Maybe

import DB
import FancyHtml

main = runCGI $ handleErrors cgiMain

cgiMain = do
    username <- getInput "username"
    password <- getInput "password"
    let pass = fromJust password
    let user = fromJust username
    liftIO $ db_insert $ "INSERT INTO users VALUES ('" ++ user ++ "','" ++ pass ++ "')"
    output $ header ++ "Thank you for registering." ++ (quote "Computing's core challenge is how not to make a mess of it." "http://www.schnada.de/quotes/contempt.html" "Edsger W. Dijkstra") ++ footer
