Working CGI, partially tested with phpmyadmin