Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Alphabet Search Not Working [More Info]

Quote Reply
Alphabet Search Not Working [More Info]
I attach a copy of my HTML.pl file. Please can anyone help me.

Code

##########################################################
## Home Page ##
##########################################################

sub html_home {
# New Code Required for Alphabet Links
$name_field=2; # change this to the number of the last name field
$db_file_name = '/home/bizSuccess/cgi-bin/dbman/db.cgi ';
#open (DB, "<@db_connect") or &cgierr("error. unable to open db file: $db_file_name.\nReason: $!"); if ($db_use_flock) { flock(DB, 1); }
$DBH = DBI->connect (@db_connect) or &cgierr ("Connection Error. Reason: " . $DBI::errstr . "\n.");
@lines = <DB>;
close DB;

foreach $line (@lines) {
chomp $line;
@data = &split_decode($line);
$letter = substr(@data[$name_field],0,1);
$ascii = ord ($letter);
$letters[$ascii] = 1;
}
for ($i = 65; $i <=90; ++$i) {
$letter = chr($i);
if ($letter[$i]) {
print qq|
<a href="$db_script_link_url&Company_Name=\^$letter&re=on&mh=1&sb=1&so=ascend&view_records=1">$letter</a>
|;
}
else {
print "$letter ";
}
}

# --------------------------------------------------------
# The database manager home page.

$page_title = "Main Menu";
&html_page_top;

# < -- Start page text -- >
print qq|
<$face size="1"><b>
Permissions:
|;
print " View " if ($per_view);
print " Add " if ($per_add);
print " Delete " if ($per_del);
print " Modify " if ($per_mod);
print " Admin " if ($per_admin);
$i = 65;
print "<TABLE><TR>";
while ( $i < 91 ) {
print qq|<TD><PRE><BIG><A HREF="$db_script_link_url&Company_Name=^|;
#print chr($i);
print qq|&re=on&view_records=1"><B>|;
print chr($i);
print qq|</B></A></BIG></PRE></TD>\n|;
$i++;
}
print "</TR></TABLE>";

print " None " if (!($per_view || $per_add || $per_del || per_mod));
print qq|</b></font>
<P><$font>
Thanks for logging in. I hope that this database meets your requirements


<em>Enjoy!</em> and let me <a href="mailto:adebaya\@aol.com">know</a> if you have any comments!
</font></p>
|;
# < -- End page text -->

&html_footer;
&html_page_bottom;
}




Subject Author Views Date
Post Alphabet Search Not Working [More Info] ade 1626 Jan 15, 2001, 3:28 PM