oddabon :: mkcgi v2.1

form.html + mkcgi = form.cgi


mkcgi is a simple command line utility for producing a form processing perl CGI script instantly by parsing an existing HTML form. The resulting perl script is easy to understand and customize. Features include error checking, confirmation email sent to the admin and user, plain text tab delimited logging, MySQL support and redirection to a thank you page.


Usage: mkcgi [OPTIONS] form.html form.cgi
  -i, --interactive		Interactive mode, prompts you for values

  --admin-log=filename		Full path and filename to save form posts
  --admin-email=email		This person(s) receives the form posts
  --admin-from=field		Email address field name in the HTML form
  --admin-subject=text		The subject line of the email sent to the admin

  --user-from=email		Reply-to email address the user will receive
  --user-subject=text		The subject line of the email sent to the user
  --user-thanks=url		Full URL to the thank you page

  --mysql-on			Enable MySQL support
  --mysql-host=hostname		MySQL hostname
  --mysql-user=username		MySQL user name
  --mysql-pass=password		MySQL password
  --mysql-db=database		MySQL database name
  --mysql-table=table		MySQL table name

  --help			Display this help and exit
  --version			Output version information and exit


mkcgi takes [options] and 2 arguments. The first is the html file name of the form you want it to parse and the second is the file name of the cgi script you want to create.

It will load the form field values into your favorite UNIX editor. You'll need to verify the field names look accurate and remove any duplicates (radio buttons) or other unnecessary HTML.

Next edit the proper field names that will be used for error checking and displayed to the user.

Next edit configuration information and comment out fields that are not required or add special error checking.

A SQL file will be created that you can load into MySQL so your data can be inserted.

Your CGI script is ready!


mkcgi.tgz - mkcgi.bz2 - mkcgi.zip - mkcgi.txt


sample script, sample table

©2007 mkcgi