Here is my code that works perfectly...The question is below...
#!C:/Perl/bin/perl.exe
use CGI;
CGI::ReadParse(*in);
$file = 'c:\CBC\UserQuery.txt';
print "Content-type:text/html\n\n";
print '<HTML><HEAD><TITLE>saveform.cgi results</TITLE></HEAD>';
print '<h2>Here are the results of your query.</h2>';
print '</BODY></HTML>';
open(FILE, ">$file")||die "Can't open $file";
flock(FILE, 2)||die "Can't lock $file";
foreach $i (keys %in) {
print FILE "$in{$i}\n";
}
print FILE "\n";
close(FILE) || die "Can't close $file";
#Step1:
use DBI;
my $data_source = q/dbi:ODBC:MEMLOGDB/;
my $user = q/NameChangedToProtectTheInnocent/;
my $password = q/CantTellYouThatEither/;
# Connect to the database (1st time)
my $dbh = DBI->connect($data_source, $user, $password)
or die "Can't connect to $data_source: $DBI::errstr";
my $sql1 = "SELECT csite,ccallid,cdatim,cansr,cagt,ctrxfr,cintcllid FROM UCBC WHERE CCLID = '8885551212' ORDER BY cdatim DESC";
my $sth1 = $dbh->prepare($sql1) or die "Can't prepare statement: $DBI::errstr";
$sth1->execute();
while ( my @row1 = $sth1->fetchrow_array ) {
print "@row1<br>\n";
}
$dbh->disconnect; close (OUT);
******************
So here is what I am doing...
I have a web page where the user inputs a phone number.
That phone number is then stored in a text file on the web sever.
Next I have a hard coded sql query that looks up records based on a phone number that is currently hard coded.
My question is, how do I get the phone number that the user entered, and make it the number I use in my look up?
Make sense?
#!C:/Perl/bin/perl.exe
use CGI;
CGI::ReadParse(*in);
$file = 'c:\CBC\UserQuery.txt';
print "Content-type:text/html\n\n";
print '<HTML><HEAD><TITLE>saveform.cgi results</TITLE></HEAD>';
print '<h2>Here are the results of your query.</h2>';
print '</BODY></HTML>';
open(FILE, ">$file")||die "Can't open $file";
flock(FILE, 2)||die "Can't lock $file";
foreach $i (keys %in) {
print FILE "$in{$i}\n";
}
print FILE "\n";
close(FILE) || die "Can't close $file";
#Step1:
use DBI;
my $data_source = q/dbi:ODBC:MEMLOGDB/;
my $user = q/NameChangedToProtectTheInnocent/;
my $password = q/CantTellYouThatEither/;
# Connect to the database (1st time)
my $dbh = DBI->connect($data_source, $user, $password)
or die "Can't connect to $data_source: $DBI::errstr";
my $sql1 = "SELECT csite,ccallid,cdatim,cansr,cagt,ctrxfr,cintcllid FROM UCBC WHERE CCLID = '8885551212' ORDER BY cdatim DESC";
my $sth1 = $dbh->prepare($sql1) or die "Can't prepare statement: $DBI::errstr";
$sth1->execute();
while ( my @row1 = $sth1->fetchrow_array ) {
print "@row1<br>\n";
}
$dbh->disconnect; close (OUT);
******************
So here is what I am doing...
I have a web page where the user inputs a phone number.
That phone number is then stored in a text file on the web sever.
Next I have a hard coded sql query that looks up records based on a phone number that is currently hard coded.
My question is, how do I get the phone number that the user entered, and make it the number I use in my look up?
Make sense?