File: x10cgi_nodbi.pl

package info (click to toggle)
libdbd-informix-perl 2003.04-3
  • links: PTS
  • area: contrib
  • in suites: etch, etch-m68k, sarge
  • size: 1,232 kB
  • ctags: 467
  • sloc: perl: 7,349; ansic: 5,340; sh: 184; makefile: 58
file content (43 lines) | stat: -rwxr-xr-x 1,212 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/perl -w
#
# @(#)$Id: x10cgi_nodbi.pl,v 100.1 2002/02/08 22:50:13 jleffler Exp $
#
# Simple example of self-populating (self-regenerating) CGI Form
# Cribbed from CGI.pm documentation.
#
# Copyright 1998 Jonathan Leffler
# Copyright 2000 Informix Software Inc
# Copyright 2002 IBM

use strict;
use CGI qw/:standard/;

my $clear = (param('reset')) ? 1 : 0;
my @rainbow = ('red', 'orange', 'yellow', 'green', 'blue', 'indigo', 'violet');
Delete_all if $clear;

print header,
		start_html('A Simple Example'),
		h1('A Simple Example'),
		start_form,
		"What's your name? ",
		textfield(-name=>'name', -default=>'', -override=>$clear), p,
		"What's the combination?", p,
		checkbox_group(	-name=>'words', -override=>$clear,
						-value=>['eenie', 'meenie', 'minie', 'moe'],
						-default=>['eenie', 'meenie']), p,
		"What's your favourite colour? ",
		popup_menu( -name=>'colour', -override=>$clear,
					-value=>[@rainbow]), p,
		submit, submit(-name=>'reset', -value=>'Clear Form'),
		end_form,
		hr;

if (param('name'))
{
	print "Your name is ", em(param('name')), p,
			"You think the keywords are: ", em(join(", ", param('words'))), p,
			"Your favourite colour is ", em(param('colour')),
			hr;
}