Cover V04, I03
Article
Figure 1
Listing 1
Listing 2
Sidebar 1
Sidebar 2

may95.tar


Listing 1: request_form.pl

#!/usr/bin/perl
# request_form.pl by johnk@dop.water.ca.gov created 1-23-95
# displays HTML based request form
#
############################################### Begin main code.
$ident=$ENV{REMOTE_IDENT};      # Try to get the users' uname.
if (@pwent=getpwnam($ident))
{                               # We have the uname.
$have_uname=1;                # Set this so we won't look for info later.
($rname)=split(/\,/, $pwent[6]);
}
&print_form;                    # Output the HTML form.
exit;

############################################### End main code.
# subroutines in alpha order.
sub print_form
{
print "Content-type:  text/html\n\n\n";
print"<Head><TITLE>ComputerSupport</TITLE></Head><Body>\n"
if (! $have_uname)
{
print "<center><H1>The DOP RequestPage</H1></center>\n";
print "<H3>Please enter the appropiate information in the following fields:</H3>\n";
print "Username:     <input name=\"uname\" size=20 maxlength=30> <br>\n";
print "Real Name:    <input name=\"rname\" size=30 maxlength=30> <br>\n";
print "Phone number: <input name=\"phone\" size=10 maxlength=10>
<br>\n";
print "Location:     <input name=\"room\" size=10 maxlength=10> <br>\n";
} else
{
print "<center><H1>$rname...Welcome to The DOP
RequestPage!</H1></center>\n";
print "<H3>Please enter the appropiate information in the
following fields:</H3>\n";
}
print "<form action=\"/cgi-bin/request_submit.pl\"
method=\"POST\">\n";
print "Please enter a one line description of your problem:<br>
<input name=\"shortdesc\" size=40 maxlength=100><br>
Priority level:<br>
<select name=\"level\" >
<option value=\"EMERGENCY\">EMERGENCY
<option value=\"high\">High
<option value=\"medium\" selected>Medium
<option value=\"low\">Low
</select>
<br>Now leave a more detailed description:
<textarea name=\"longdesc\" cols=60 rows=10>
</textarea>
<center>
<input type=submit value=\"Submit Request\">
<input type=reset value=\"Start Over\">
</center>
</pre>
</form>
<HR>
<img src = \"/images/bottom.gif\">
</Body>\n";
}