chief_wpd has asked for the wisdom of the Perl Monks concerning the following question:
Thanks for the help, Brian#!/usr/bin/perl use CGI qw(:standard); print header; print start_html, start_form(-method=>'POST', -action=>'http://www.winterspd.com/cgi-bin +/access.pl'), print "<h1><P ALIGN=CENTER><font color=blue>Winters Police Department <br>Local Warrants Check</font></P></h1><p>", "<h2>To check for warrants on any person please enter a last name only + for a general check, or to narrow your search, enter a first name as well. Searches cannot b +e made by first name alone.<p>", "Enter Last Name \t", textfield(-name=>'Last_Name', -size=>16, -maxlen +gth=>24), "<br>Enter First Name \t", textfield(-name=>'First_Name', -size=>16, - +maxlength=>24); print "<p><p><p>", "If you find that you, or someone you know is wanted, please call +the City of Winters Police Department, or the City Municipal Judge, Gary Moore, and make arra +ngements to take care of your Warrants.<p>It should be understood that although you may find war +rant information on this page, it does not necessarily mean that the warrants are active, and tha +t warrant status may change between updates of the page.<p>Thank you for your interest."; print "<p>", submit(-name=>'Submit'), reset(-name=>'Reset Form'); print end_html; __________________________________________________ #!/usr/bin/perl use CGI qw(:standard); $query = new CGI; # Get CGI form data from accessStart.pl $Lastname = $query->param('Last_Name'); $Firstname = $query->param('First_Name'); #Windows-based Perl/DBI/MS Access example use DBI; #open connection to Access database my $dbh = DBI->connect('dbi:ODBC:LEDR'); #prepare and execute SQL statement if ($Firstname ne ""){ $sth=$dbh->prepare("SELECT [Master Name].[Last Name], [Master Nam +e].[First Name], [Master Name].[Middle Name], [Master Name].[Date of Birth], Locals.[Warrant (Cause) Number], Locals.[Offense Committed], Local +s.[Current Status], Locals.[Date issued] FROM Locals INNER JOIN [Master Name] ON Locals.[Person ID] = [Master Name].[Person ID] WHERE ((([Master Na +me].[Last Name])='$Lastname') AND (([Master Name].[First Name])='$Fir +stname'))");} if ($Firstname eq "") { $sth=$dbh->prepare("SELECT [Master Name].[Last Name], [Master Nam +e].[First Name], [Master Name].[Middle Name], [Master Name].[Date of Birth], Locals.[Warrant (Cause) Number], Locals.[Offense Committed], Local +s.[Current Status], Locals.[Date issued] FROM Locals INNER JOIN [Master Name] ON Locals.[Person ID] = [Master Name].[Person ID] WHERE ((([Master Na +me].[Last Name])='$Lastname'))");} print header(); print start_html; print ("<h1><P ALIGN = CENTER>Winters Police Department<br> Local +Warrant Check</h1></P><p>"); $sth->execute; while (@row=$sth->fetchrow_array()){ $firstname=$row[1]; $midname=$row[2]; $dob=$row[3]; $warrantnum=$row[4]; $offense=$row[5]; $status=$row[6]; $date=$row[7]; print "<h2>$firstname $midname $Lastname<br>DOB: $dob<br><font + color=red> Warrant number:</font> $warrantnum <font color=red><br>Status:</font> $status<br><font color +=red>Offense</font> $offense </h2> <font color=red><H3>Date Issued:</font> $date<br></H +3> __________________________________________________________ +___________________<p>";} if ($Firstname eq ""){print "<h2><font color=Blue>No other match f +ound for Name: $Lastname.</font></h2><br>";} if ($Firstname ne ""){print "<h2><font color=blue>No other match f +ound for Name: $Firstname $Lastname.</font></h2>";} print end_html;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI on Web Host?
by dws (Chancellor) on Feb 15, 2003 at 06:05 UTC | |
|
Re: DBI on Web Host?
by steves (Curate) on Feb 15, 2003 at 09:27 UTC | |
|
Re: DBI on Web Host?
by Desdinova (Friar) on Feb 15, 2003 at 10:56 UTC | |
|
Re: DBI on Web Host?
by Ryszard (Priest) on Feb 15, 2003 at 12:53 UTC | |
|
Re: DBI on Web Host?
by Anonymous Monk on Feb 15, 2003 at 15:25 UTC | |
|
Re: DBI on Web Host?
by Wysardry (Pilgrim) on Feb 15, 2003 at 22:18 UTC |