Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Perl >> Snippet

CGI script for web page with complete form


#!/usr/bin/perl

print << WEBPAGE;
Content - type: text / html

< html >
< head >
< title > my Web Page </ title >
</ head >
< body >
< h2 > my Web Page </ h2 >
This page brought to you by ...
< form action = " http://www.vbinformation.com/cgi -bin/gbsample.pl" method = "GET" >

< input type = "text" name = "singletext" value = "Sample info" size = "8" maxlength = "8" >

< input type = "hidden" name = "hiddentext" value = "state information" >

< input type = "password" name = "pswline" value = "Sample info" size = "8" maxlength = "20" >
< input type = "radio" name = "choose" value = "Dog" > Dog
< input type = "radio" name = "choose" value = "Cat" > Cat
< input type = "radio" name = "choose" value = "Pig" checked > Pig
< p >
< input type = "checkbox" name = "pickme" checked > Please pick me !

< select name = "purchase" size = "4" >
< option > Cereal
< option selected > Toast
< option > Bread
< option > Milk
< option > Butter
< option > Fruit
</ select >

< textarea name = "bulktext" rows = 5 cols = 20 >
Default text content is placed here .
</ textarea >

< p >
< input type = "submit" value = "Submit" >
< input type = "reset" >
</ form >

</ BODY >
</ html >
WEBPAGE                 #no trailing spaces allowed