#!/usr/bin/perl require "thevars.pl"; $mailserver = "206.152.180.10"; ############################################## # Print The Page Header # print "Content-type: text/html\n\n"; print <<"EOF"; Transport Universe - Transportation Auction and Car Auctions
Search Transport Universe    
or the World Wide Web     

CLASSIFIEDS
Premier Dealerships Get paid cash to list ads on TU!
CLICK HERE!
AUCTIONS
DEALERS

WANTED

JOBS

B2B




Our Exclusive Condition Report is like having every expert you ever needed at your fingertips.
SEE EXAMPLE



Millions of page views every month!


 Over 1800 Transportation Categories.




EOF ; # ############################################## ############################################## &get_form_data; # parse arguments from post @ARGV = split(/\\*\&/, $ENV{'QUERY_STRING'}); $ARGV[0] =~ s/\W//g; #$ARGV[1] =~ s/\D//g; if ($form{'action'} eq 'bid') { &procbid; } elsif ($form{'action'} eq 'new') { &procnew; } elsif ($form{'action'} eq 'repost') { &newitem; } elsif ($form{'action'} eq 'accepted') { &accepted; } elsif ($ARGV[0] eq 'all') { &allcategory; } elsif ($ARGV[2] eq 'n') { &newitem; } elsif (($regdir ne "") && ($ARGV[0] eq $regdir)) { &dispcat; } # be sure nobody is trying to hack the user dir else { &newitem; } ############################################## # Print The Page Footer # print <<"EOF";
Copyright © 1999/2000 Transport Universe Inc. All Rights Reserved.
 Use of this Web site constitutes acceptance of the TRANSPORT UNIVERSE User Agreement

EOF ; ############################################## # Sub: Add New Item sub newitem { $inc = "1.00"; if ($form{'REPOST'}) { if (open (THEFILE, "$basepath$closedir/$form{'REPOST'}.dat")) { ($title, $reserve, $inc, $desc, $loca, $image, $image2, $image3, $image4, $cat1, $cat2, $cat3, $cat4, @bids) = ; $title =~ s/\"//g; # quotes cause problems for a text input field close THEFILE; } } print <<"EOF";
Place An Auction Listing
Put a vehicle up for auction to the highest bidder. Live Auctions are a great way to move trade-in vehicles and to promote your dealership!
Title:
Should include Year, Make, Model, etc.
Categories:
Select up to four categories that specifically represent your vehicle, equipment or item.
MULTIPLE CATEGORY LISTING

EOF print "\n"; } } print "<\/SELECT>    Optional
\n"; print "\n"; } } print "<\/SELECT>    Optional
\n"; print <<"EOF";
Image 1 URL:
Including a picture in this field will attach a \[PIC\] icon next to your title in all listings.

Picture URLs usually read as follows:
http://server address/page/image.gif or image.jpg
Need Help? Click here for advice and free image hosting 
Image 2 URL:
(Optional)
Image 3 URL:
(Optional)
Image 4 URL:
(Optional)
Length of ad in days:
1-90
Description:
Put your dealerships banners, graphics and information at the top followed by the vehicle description.

Vehicle and equipment descriptions should include relevant title and financial status.
Item Location:
This is the actual location of the item. City, State or Province, Country
Your UserName:
Your Password :
CLICK HERE to request a forgotten password
Your Starting Bid:


Required
\$
This is the minimum price you will accept for your item.
Please use numbers and periods only. No commas or dollar signs.
Your Reserve Price:

Optional
\$
You have the option of setting a low Starting Bid and using a Reserve Price to set a hidden minimum that must be met in order produce a winning bid. The minimum may attract more bidders, but most customers prefer an up front minimum price.
Bid Increment: \$
If selling a vehicle, we recommend that you set this to at least \$100.


EOF } ############################################## # Sub: Preview sub preview { $nowtime = localtime(time); $closetime = localtime($form{'ITEM'}); $desc = "$form{'DESC'}" if ($form{'DESC'}); $image = "" if ($form{'IMAGE'}); $image2 = "" if ($form{'IMAGE2'}); $image3 = "" if ($form{'IMAGE3'}); $image4 = "" if ($form{'IMAGE4'}); print "

PREVIEW

\n"; print "
$form{'TITLE'}
Category : $category{$form{'CATEGORY'}}
Category2: $category{$form{'CATEGORY2'}}
Category3: $category{$form{'CATEGORY3'}}
Category4: $category{$form{'CATEGORY4'}}
Seller: $form{'ALIAS'}
Current Time: $nowtime
Auction Closes: $closetime
Or $aftermin minutes after last bid...
Item Location: $form{'LOCA'}
Starting Bid: \$$form{'BID'}


If this is satisfactory, Or click the BACK button on your browser to edit the item. Please fill in all fields. You may have to re-enter your password.
Thank You.



\n"; foreach $key (keys %form) { $form{$key} =~ s/\>/\[greaterthansign\]/gs; $form{$key} =~ s/\\n"; } print "
\n"; print "
$desc
Description

"; print "
$image $image2 $image3 $image4
\n"; } ############################################## # Sub: Process New Item sub procnew { if ($regdir ne "") { $form{'ALIAS'} =~ s/\W//g; $form{'ALIAS'} = lc($form{'ALIAS'}); $form{'ALIAS'} = ucfirst($form{'ALIAS'}); &oops('ALIAS') unless (open(REGFILE, "/u1/www/transportuniverse/dealer/$regdir/$form{'ALIAS'}.dat")); ($password, $form{'regtype'}, $form{'ALIAS'}, $form{'CONAM'}, $form{'COSTREET'}, $form{'COCITY'}, $form{'COSTATE'}, $form{'COZIP'}, $form{'TELNO'}, $form{'EMAIL'}, $form{'COBANNER'}, $form{'PTELL'}, $form{'url'}, @userbids) = ; close REGFILE; chomp($password, $form{'regtype'}, $form{'ALIAS'}, $form{'CONAM'}, $form{'COSTREET'}, $form{'COCITY'}, $form{'COSTATE'}, $form{'COZIP'}, $form{'TELNO'}, $form{'EMAIL'}, $form{'COBANNER'}, $form{'PTELL'}, $form{'url'}, @userbids); &oops('PASSWORD') unless ((lc $password) eq (lc $form{'PASSWORD'})); } &oops('TITLE') unless ($form{'TITLE'} && (length($form{'TITLE'}) < 51)); $form{'TITLE'} =~ s/\/\>\;/g; &oops('CATEGORY') unless (-d "$basepath$form{'CATEGORY'}"); $form{'IMAGE'} = "" if ($form{'IMAGE'} eq "http://"); $form{'IMAGE2'} = "" if ($form{'IMAGE2'} eq "http://"); $form{'IMAGE3'} = "" if ($form{'IMAGE3'} eq "http://"); $form{'IMAGE4'} = "" if ($form{'IMAGE4'} eq "http://"); &oops('DAYS') unless (($form{'DAYS'} > 0) && ($form{'DAYS'} < 31)); &oops('DESC') unless ($form{'DESC'}); &oops('LOCA') unless ($form{'LOCA'}); &oops('BID') unless ($form{'BID'} =~ /^(\d+\.?\d*|\.\d+)$/); &oops('INC') unless (($form{'INC'} =~ /^(\d+\.?\d*|\.\d+)$/) && ($form{'INC'} >= .01)); $form{'INC'} = &parsebid($form{'INC'}); $form{'ITEM'} = ($form{'DAYS'} * 86400 + time); $form{'ITEM'} = ($form{'DAYS'} * 86400 + time) until (!(-f "$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat")); if ($form{'FROMPREVIEW'}) { foreach $key (keys %form) { $form{$key} =~ s/\[greaterthansign\]/\>/gs; $form{$key} =~ s/\[lessthansign\]/\$basepath$form{'CATEGORY4'}/temp/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'TITLE'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'DESC'}\n$form{'LOCA'}\n$form{'IMAGE'}\n$form{'IMAGE2'}\n$form{'IMAGE3'}\n$form{'IMAGE4'}\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}"; close NEWAUCTION; } if ($form{'CATEGORY3'} ne "") { mkdir("$basepath$form{'CATEGORY3'}/temp" , 0777); &oops('ITEM') unless (open(NEWAUCTION, ">$basepath$form{'CATEGORY3'}/temp/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'TITLE'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'DESC'}\n$form{'LOCA'}\n$form{'IMAGE'}\n$form{'IMAGE2'}\n$form{'IMAGE3'}\n$form{'IMAGE4'}\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}"; close NEWAUCTION; } if ($form{'CATEGORY2'} ne "") { mkdir("$basepath$form{'CATEGORY2'}/temp" , 0777); &oops('ITEM') unless (open(NEWAUCTION, ">$basepath$form{'CATEGORY2'}/temp/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'TITLE'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'DESC'}\n$form{'LOCA'}\n$form{'IMAGE'}\n$form{'IMAGE2'}\n$form{'IMAGE3'}\n$form{'IMAGE4'}\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}"; close NEWAUCTION; } if ($form{'CATEGORY'} ne "") { mkdir("$basepath$form{'CATEGORY'}/temp" , 0777); &oops('ITEM') unless (open(NEWAUCTION, ">$basepath$form{'CATEGORY'}/temp/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'TITLE'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'DESC'}\n$form{'LOCA'}\n$form{'IMAGE'}\n$form{'IMAGE2'}\n$form{'IMAGE3'}\n$form{'IMAGE4'}\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}"; close NEWAUCTION; } &sendemail('postmaster@transportuniverse.com', ' FREE DEALER AUCTION POSTED', 'nobody', $mailserver, "A listing has been placed on the AUCTION site by a DEALER.\n\nUSER NAME\: $form{'ALIAS'}\nTITLE\: $form{'TITLE'}\n\nVISIT\: http\:\/\/www.transportuniverse.com\/cgi-transportuniverse\/auction.cgi\?$form{'CATEGORY'}\&$form{'ITEM'}\n\nPRICE is \$$form{'BID'}.\nThis listing has been placed in the following categories\:\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}\n"); $newbidflag=1; if (($form{'BID'} > 50000000000000) || ($form{'RESERVE'} > 50000000000000)) { &proccessor; } else { &oops('ITEM') unless (open(NEWAUCTION, ">$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'TITLE'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'DESC'}\n$form{'LOCA'}\n$form{'IMAGE'}\n$form{'IMAGE2'}\n$form{'IMAGE3'}\n$form{'IMAGE4'}\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}"; close NEWAUCTION; &oops('ITEM') unless (open(NEWAUCTION, ">$basepath$form{'CATEGORY2'}/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'TITLE'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'DESC'}\n$form{'LOCA'}\n$form{'IMAGE'}\n$form{'IMAGE2'}\n$form{'IMAGE3'}\n$form{'IMAGE4'}\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}"; close NEWAUCTION; &oops('ITEM') unless (open(NEWAUCTION, ">$basepath$form{'CATEGORY3'}/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'TITLE'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'DESC'}\n$form{'LOCA'}\n$form{'IMAGE'}\n$form{'IMAGE2'}\n$form{'IMAGE3'}\n$form{'IMAGE4'}\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}"; close NEWAUCTION; &oops('ITEM') unless (open(NEWAUCTION, ">$basepath$form{'CATEGORY4'}/$form{'ITEM'}.dat")); print NEWAUCTION "$form{'TITLE'}\n$form{'RESERVE'}\n$form{'INC'}\n$form{'DESC'}\n$form{'LOCA'}\n$form{'IMAGE'}\n$form{'IMAGE2'}\n$form{'IMAGE3'}\n$form{'IMAGE4'}\n$form{'CATEGORY'}\n$form{'CATEGORY2'}\n$form{'CATEGORY3'}\n$form{'CATEGORY4'}"; close NEWAUCTION; $newbidflag=1; &thankyou; } } else { &preview; } } ############################################## # Sub: Ad Has Been Placed! sub thankyou { if (($regdir ne "") && !($newbidflag)) { $form{'ALIAS'} =~ s/\W//g; $form{'ALIAS'} = lc($form{'ALIAS'}); $form{'ALIAS'} = ucfirst($form{'ALIAS'}); &oops('TACO') unless (open(REGFILE, "/u1/www/transportuniverse/dealer/$regdir/$form{'ALIAS'}.dat")); ($password, $form{'regtype'}, $form{'ALIAS'}, $form{'CONAM'}, $form{'COSTREET'}, $form{'COCITY'}, $form{'COSTATE'}, $form{'COZIP'}, $form{'TELNO'}, $form{'EMAIL'}, $form{'COBANNER'}, $form{'PTELL'}, $form{'url'}, @userbids) = ; close REGFILE; chomp($password, $form{'regtype'}, $form{'ALIAS'}, $form{'CONAM'}, $form{'COSTREET'}, $form{'COCITY'}, $form{'COSTATE'}, $form{'COZIP'}, $form{'TELNO'}, $form{'EMAIL'}, $form{'COBANNER'}, $form{'PTELL'}, $form{'url'}, @userbids); &oops('PASSWORD') unless ((lc $password) eq (lc $form{'PASSWORD'})); } &oops('EMAIL') unless ($form{'EMAIL'} =~ /.+\@.+/); &oops('BID') unless ($form{'BID'} =~ /^(\d+\.?\d*|\.\d+)$/); $form{'BID'} = &parsebid($form{'BID'}); $timenum = time; $thetime = localtime(time); &oops('ITEM') unless (open ITEM, "$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat"); ($title, $reserve, $inc, $desc,$loca,$image, $image2, $image3, $image4, $cat1, $cat2, $cat3, $cat4, @bids) = ; close ITEM; chomp($title, $reserve, $inc, $desc,$loca,$image, $image2, $image3, $image4, $cat1, $cat2, $cat3, $cat4, @bids); @lastbid = split(/\[\]/,$bids[$#bids]); if ((((time <= $form{'ITEM'}) || (time <= (60 * $aftermin + $lastbid[3]))) && ($form{'BID'} >= $lastbid[2] + $inc)) || ($newbidflag == 1)) { &oops('ITEM') unless (open NEWITEM, ">>$basepath$form{'CATEGORY'}/$form{'ITEM'}.dat"); &filelock if ($flock); print NEWITEM "\n$form{'ALIAS'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; if ($image ne "") { $picture = "Y"; } else { $picture = "N"; } open DBFILE, ">>/u1/www/transportuniverse/db1/db1.dat"; &filelock if ($flock); print DBFILE "\n \|$picture\|$year\|$make\|$model\|$title\|$desc\|$loca\|$form{'BID'}\|$country\|$state\|$city\|auction\|$cat1\|$form{'ITEM'}"; close DBFILE; if ($form{'CATEGORY2'} ne "") { &oops('ITEM') unless (open NEWITEM, ">>$basepath$form{'CATEGORY2'}/$form{'ITEM'}.dat"); &filelock if ($flock); print NEWITEM "\n$form{'ALIAS'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; if ($image ne "") { $picture = "Y"; } else { $picture = "N"; } open DBFILE, ">>/u1/www/transportuniverse/db1/db1.dat"; &filelock if ($flock); print DBFILE "\n \|$picture\|$year\|$make\|$model\|$title\|$desc\|$loca\|$form{'BID'}\|$country\|$state\|$city\|auction\|$cat2\|$form{'ITEM'}"; close DBFILE; } if ($form{'CATEGORY3'} ne "") { &oops('ITEM') unless (open NEWITEM, ">>$basepath$form{'CATEGORY3'}/$form{'ITEM'}.dat"); &filelock if ($flock); print NEWITEM "\n$form{'ALIAS'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; if ($image ne "") { $picture = "Y"; } else { $picture = "N"; } open DBFILE, ">>/u1/www/transportuniverse/db1/db1.dat"; &filelock if ($flock); print DBFILE "\n \|$picture\|$year\|$make\|$model\|$title\|$desc\|$loca\|$form{'BID'}\|$country\|$state\|$city\|auction\|$cat3\|$form{'ITEM'}"; close DBFILE; } if ($form{'CATEGORY4'} ne "") { &oops('ITEM') unless (open NEWITEM, ">>$basepath$form{'CATEGORY4'}/$form{'ITEM'}.dat"); &filelock if ($flock); print NEWITEM "\n$form{'ALIAS'}\[\]$form{'EMAIL'}\[\]$form{'BID'}\[\]$timenum\[\]$form{'ADDRESS1'}\[\]$form{'ADDRESS2'}\[\]$form{'ADDRESS3'}"; close NEWITEM; if ($image ne "") { $picture = "Y"; } else { $picture = "N"; } open DBFILE, ">>/u1/www/transportuniverse/db1/db1.dat"; &filelock if ($flock); print DBFILE "\n \|$picture\|$year\|$make\|$model\|$title\|$desc\|$loca\|$form{'BID'}\|$country\|$state\|$city\|auction\|$cat4\|$form{'ITEM'}"; close DBFILE; } print "
$form{'ALIAS'}, your Item Number is $form{'ITEM'}.
Your item has been listied in the following categories:
$category{$form{'CATEGORY'}} - $category{$form{'CATEGORY2'}}
$category{$form{'CATEGORY3'}} - $category{$form{'CATEGORY4'}}
You may wish to print this notice as confirmation of your Classified Listing.

\n"; print "

YOU SHOULD NOW CLICK HERE TO GO BACK TO THE ITEM YOU HAVE JUST LISTED AND ADD A COMPREHENSIVE CONDITION REPORT


Attract serious interest from serious buyers by providing them with the essential details found in one our exclusive reports.
\n"; if ($form{'CATEGORY2'} eq "") { $item2 eq ""; } else { $item2 = "$form{'ITEM'}"; } if ($form{'CATEGORY3'} eq "") { $item3 eq ""; } else { $item3 = "$form{'ITEM'}"; } if ($form{'CATEGORY4'} eq "") { $item4 eq ""; } else { $item4 = "$form{'ITEM'}"; } $flag=0; foreach $userbid(@userbids) { $flag=1 if ("$form{'CATEGORY'}$form{'ITEM'}" eq $userbid); } if ($flag==0 && $regdir ne "") { &oops('BELL') unless (open(REGFILE, ">>$basepath$regdir/$form{'ALIAS'}.dat")); print REGFILE "\n$form{'CATEGORY'}$form{'ITEM'}\[\]$form{'CATEGORY2'}$item2\[\]$form{'CATEGORY3'}$item3\[\]$form{'CATEGORY4'}$item4"; close REGFILE; &oops('ADMIN') unless (open(RFILE, ">>/u1/www/transportuniverse/dealer/ISMListings/$form{'ALIAS'}.dat")); print RFILE "\n$form{'CATEGORY'}$form{'ITEM'}\[\]$form{'CATEGORY2'}$item2\[\]$form{'CATEGORY3'}$item3\[\]$form{'CATEGORY4'}$item4\[\]auction"; close RFILE; } $bob=1; } else { $bob=1; } } ############################################## # Sub: parse bid sub parsebid { $_[0] =~ s/\,//g; @bidamt = split(/\./, $_[0]); $bidamt[0] = "0" if (!($bidamt[0])); $bidamt[0] = int($bidamt[0]); $bidamt[1] = substr($bidamt[1], 0, 2); $bidamt[1] = "00" if (length($bidamt[1]) == 0); $bidamt[1] = "$bidamt[1]0" if (length($bidamt[1]) == 1); return "$bidamt[0].$bidamt[1]"; } ############################################## # Sub: Oops! sub oops { print "

E R R O R

Something is wrong with the $_[0] section.

Please hit BACK to try again!

\n"; exit; } ############################################## # Sub: Movefile(file1, file2) sub movefile { ($firstfile, $secondfile) = @_; return 0 unless open(FIRSTFILE,$firstfile); @lines=; close FIRSTFILE; return 0 unless open(SECONDFILE,">$secondfile"); foreach $line (@lines) { print SECONDFILE $line; } close SECONDFILE; return 0 unless unlink($firstfile); return 1; } ############################################## # SUB: Send E-mail sub sendemail { use Socket; $TO=$_[0]; @TO=split('\0',$TO); $SUBJECT=$_[1]; $REPLYTO=$_[2]; $REMOTE = $_[3]; $THEMESSAGE = $_[4]; if ($REMOTE =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/) { $addr = pack('C4', $1, $2, $3, $4); } else { die("Bad IP address: $!"); } $port = 25 unless $port; $port = getservbyname($port,'tcp') if $port =~ /\D/; $proto = getprotobyname('tcp'); socket(S, PF_INET, SOCK_STREAM, $proto) or die("Socket failed: $!"); $sockaddr = 'S n a4 x8'; # shouldn't this be in Socket.pm? connect(S, pack($sockaddr, AF_INET, $port, $addr)) or die("Unable to connect: $!"); select(S); $| = 1; select(STDOUT); $a=; print S "HELO ${SERVERNAME}\n"; $a=; print S "MAIL FROM:postmaster\@transportuniverse\.com\n"; $a=; print S "RCPT TO:<$TO[0]>\n"; $a=; if ($#TO > 0) { foreach (1..$#TO) { print S "RCPT TO: $TO[$_]\n";$a=; } } print S "DATA \n"; $a=; print S "To: $TO[0]\n"; if ($#TO > 0) { foreach (1..$#TO) { print S "Cc: $TO[$_]\n"; } } print S "Subject: $SUBJECT\n"; # Print the body print S "$THEMESSAGE\n"; print S ".\n"; $a=; print S "QUIT"; close (S); } ############################################## # Sub: Get Form Data sub get_form_data { $buffer = ""; read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs=split(/&/,$buffer); foreach $pair (@pairs) { @a = split(/=/,$pair); $name=$a[0]; $value=$a[1]; $value =~ s/\+/ /g; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ s/~!/ ~!/g; $value =~ s/[\n\r]/ /sg; #remove \n $value =~ s/\[\]//g; #remove [] push (@data,$name); push (@data, $value); } %form=@data; %form; } ############################################## # Sub: File Lock # This locks files when bidding takes place sub filelock { flock (NEWITEM, 2); seek(NEWITEM, 0, 2); } ################################# sub Parse_Form { if ($ENV{'REQUEST_METHOD'} eq 'GET') { @pairs = split(/&/, $ENV{'QUERY_STRING'}); } elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { read (STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); if ($ENV{'QUERY_STRING'}) { @getpairs =split(/&/, $ENV{'QUERY_STRING'}); push(@pairs,@getpairs); } } else { print "Content-type: text/html\n\n"; print "

Use Post or Get"; } foreach $pair (@pairs) { ($key, $value) = split (/=/, $pair); $key =~ tr/+/ /; $key =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; $value =~s///g; if ($formdata{$key}) { $formdata{$key} .= ", $value"; } else { $formdata{$key} = $value; } } } ################################# sub ErrorMessage { print "Content-type: text/html\n\n"; print "The server can't open the file. It either doesn't exist or the permissions are wrong. \n"; exit; } #################################