WANTED
JOBS
B2B
Our Exclusive Condition Reports Show
Every Detail!
SEE EXAMPLE
ADD
REPORT TO YOUR ITEM
Millions of page views every month!
Over 1800
Transportation Categories.
|
SEARCH RESULTS
~;
print " Start A New Search";
print " |
\n";
##############################################################
# Parse from the web form
##############################################################
read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@cgiPairs = split(/&/,$buffer);
foreach $cgiPair (@cgiPairs)
{
($name,$value) = split(/=/,$cgiPair);
$value =~ s/\+/ /g;
$value =~ s/%(..)/pack("c",hex($1))/ge;
$form{$name} .= "\0" if (defined($form{$name}));
$form{$name} .= "$value";
}
################################################
# SORT THE DATABASE AND PUT RESULTS IN @database_rows
################################################
#$sortit = $form{'sortby'};
if ($form{'sortit'} eq "") { $sortit = 2; } else { $sortit = $form{'sortit'}; }
$start_display = $form{'startdisplay'};
$display_end = $form{'displayend'};
# First pick out the field, and move it to the beginning of the line
open(FILE, "$database");
flock(FILE, $LOCK_EX);
$count=0;
@row1 =;
close (FILE);
while (@row1[$count] ne "")
{
$row = @row1[$count];
@row = split (/\|/, $row);
$sortable_field = $row[$sortit];
unshift (@row, $sortable_field);
$new_row = join ("\|", @row);
push (@new_rows, $new_row);
$count++
}
# Next, sort the lines of the database
if ($form{'order'} eq "alpha")
{
@sorted_rows = sort (@new_rows);
}
else
{
@sorted_rows = reverse sort (@new_rows);
}
#now put the field back where it belongs
@database_rows = ();
foreach $sorted_row (@sorted_rows)
{
@row = split (/\|/, $sorted_row);
$sorted_field = shift (@row);
$old_but_sorted_row = join ("\|", @row);
push (@database_rows, $old_but_sorted_row);
}
#######Used to check the sorting
# open FILE, ">/u1/www/transportuniverse/db2/sorted.txt";
# print FILE (@database_rows);
# close FILE;
#################################
# END OF SORT DATABASE
#################################
$form{'searchtype'} = "all";
if ($form{'searchtext'} eq "") { $form{'searchtext'} = $searchtext; }
@searchText = split(/\x20/,$form{'searchtext'});
foreach $test (@searchText)
{
if ($test =~ /\S{2,}/)
{push (@searchKey, $test);}
}
if (! @searchKey)
{print " Please Enter One Or More Keywords. \n";}
else
{
print"\n";
print " Your search returned $hitCount entries. \n";
}
# }
# else # end Else StartSearch
# {print " Please Enter One Or More Keywords. \n";}
print qq~
|
Copyright © 1999/2000 Transport Universe Inc. All Rights Reserved. Use of this Web site constitutes
acceptance of the TRANSPORT UNIVERSE User Agreement | |