#!/usr/bin/perl -wT print "Content-type: text/html\n\n"; use strict; use warnings; use CGI; use File::Copy; use File::Temp; use Fcntl qw(:flock); use CGI::Carp qw ( fatalsToBrowser ); sub encrypt; $CGI::DISABLE_UPLOADS = 1; $ENV{'PATH'} = '/bin:/usr/bin'; print"\n"; print "
gsCAT Bidder's Reply
\n"; print <

GScat

The first customer to bid is the first served.



Home


ENDHTML my $loginfile="/home/www/gscat.com/IiPfmMReg7/GScatLOGIN.txt"; my $itemfile = "/home/www/gscat.com/IiPfmMReg7/GScatITEMlog.txt"; #my $allsellers="/home/www/gscat.com/IiPfmMReg7/GScatSELLERS.txt"; my $bidders = "/home/www/gscat.com/IiPfmMReg7/GScatBIDDERS.txt"; my $bidrecord = "/home/www/gscat.com/IiPfmMReg7/BIDrecord.txt"; my $sellers="/home/www/gscat.com/IiPfmMReg7/GScatSELLERS.txt"; my $solditems = "/home/www/gscat.com/IiPfmMReg7/soldITEMSlog.txt"; my $bidsaccepted = "/home/www/gscat.com/IiPfmMReg7/BIDSaccepted.txt"; my $bidnumber = "/home/www/gscat.com/IiPfmMReg7/BIDnumber.txt"; my $lostitems = "/home/www/gscat.com/IiPfmMReg7/LOSTitems.txt"; my $lowbids = "/home/www/gscat.com/IiPfmMReg7/lowBIDS.txt"; my $lowbidsLOCK = "/home/www/gscat.com/sem/lowBIDS.sem"; my $biddingended = "/home/www/gscat.com/IiPfmMReg7/biddingENDED.txt"; my $biddingendedLOCK = "/home/www/gscat.com/sem/biddingENDED.sem"; my $bidarchive = "/home/www/gscat.com/IiPfmMReg7/BIDarchive.txt"; my $bidarchiveLOCK = "/home/www/gscat.com/sem/BIDarchive.sem"; my $loginfileLOCK="/home/www/gscat.com/sem/GScatLOGIN.sem"; my $itemfileLOCK = "/home/www/gscat.com/sem/GScatITEMlog.sem"; #my $allsellersLOCK="/home/www/gscat.com/sem/GScatSELLERS.sem"; my $biddersLOCK = "/home/www/gscat.com/sem/GScatBIDDERS.sem"; my $bidrecordLOCK = "/home/www/gscat.com/sem/BIDrecord.sem"; my $sellersLOCK="/home/www/gscat.com/sem/GScatSELLERS.sem"; my $solditemsLOCK = "/home/www/gscat.com/sem/soldITEMSlog.sem"; my $bidsacceptedLOCK = "/home/www/gscat.com/sem/BIDSaccepted.sem"; my $bidnumberLOCK = "/home/www/gscat.com/sem/BIDnumber.sem"; my $lostitemsLOCK = "/home/www/gscat.com/sem/LOSTitems.sem"; my $repsrecord = "/home/www/gscat.com/IiPfmMReg7/REPSrecord.txt"; my $repsrecordLOCK = "/home/www/gscat.com/sem/REPSrecord.sem"; my $sendmail = "/usr/sbin/sendmail -t -oi"; my $gscats = 'staff@gscat.com'; my $gscati = 'intermediary@gscat.com'; my $z; my $ID0; my $ID1; my $ID2; my $ID3; my $ID4; my $ID5; my $ID6; my $ID7; my $bidID; my $custID; my $localID; my $seller; my $itemNUM; my $custLINE; my $custEMAIL; my $custNAME; my $custUSERNAME; my $custADDRESS1; my $custADDRESS2; my $custCITY; my $custSTATE; my $custZIP; my $custNATION; my $custPASSWORD; my $sellerEMAIL; my $sellerNAME; my $sellersline; my $itemLINE; my $itemCODE; my $itemQUANT; my $itemTITLE; my $itemPRICE; my $itemMINIMUM; my $foundCUST = 0; my $foundITEM; my $gotseller; my $gotbid = 0; my @unit; my $datarow; my $oldBIDactual; my $BIDactual; my $nextBID; my $bidDATE; my $oldBIDline; my @bids; my $n; my $nn; my $nnn; my $BIDchoice; my $acceptbid; my $otherbid; my $finalBID; my $reject; my $rejectall; my $message; my $match; my $pass; my $pass8; my $pass1; my $click=0; my $rps; my $reps = 0; my $found = "0"; my @ABC; my $gotit = 0; my $i; my @KLP; my $mag; my $doublecheck; my $aba; my $late; my $local; my $asd; my $asdcust; my $asdsold; my $OLDbidID; my $itemend = 0; my $lowbidexception = 0; my $random; my $CustName; my $inputPASSWORD; # ---------------------- my @nums; my $custLOCATION; my $string; my $line; #record each hit. my $hitrecorder = "/home/www/gscat.com/IiPfmMReg7/HITrecorder.txt"; my $hitrecorderLOCK = "/home/www/gscat.com/sem/HITrecorder.sem"; open (SEM, ">$hitrecorderLOCK"); flock (SEM, LOCK_EX); open (HIT, ">>$hitrecorder"); print HIT "r"; close HIT; close SEM; #------Pull four variables (ID=reg number and it=item number) from previous page. #Check for real people. $string=$ENV{"QUERY_STRING"}; #print "string -- $string
"; #$string =~ tr/[\*\|\\\/]/-/; @nums = split(/&/,$string); ($ID0,$bidID) = split(/=/, $nums[0]); $bidID =~ s/[^0-9L]//g; $OLDbidID = $bidID; ($ID1,$custID) = split(/=/, $nums[1]); $custID =~ s/[^0-9]//g; ($ID2,$seller) = split(/=/, $nums[2]); $seller =~ s/[^0-9]//g; ($ID3,$itemNUM) = split(/=/, $nums[3]); $itemNUM =~ s/[^0-9]//g; ($ID4,$rps) = split (/=/, $nums[4]); $rps =~ s/[^0-9]//g; ($ID5,$late) = split (/=/, $nums[5]); $late =~ s/[^0-9]//g; ($ID6,$local) = split (/=/, $nums[6]); $local =~ s/[^0-9]//g; ($ID7,$random) = split (/=/, $nums[7]); my $SAFEcharacters = "a-zA-Z0-9"; $random =~ s/[^$SAFEcharacters]//g; #print "rps -- $rps
"; #Untaint custID for use in subdirectory. if ($custID =~ /^(\d+)$/) { $custID = $1; # <-- now $custID comes from inside the program and is untainted }else{ print "Data transfer problem.
"; exit(); } if ($local == 1){ $localID = $custID; } #$pass = "n=" . $bidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=" . $reps . "&z=0"; if ($ID0 ne "n" || $ID1 ne "b" || $ID2 ne "s" || $ID3 ne "m" || $ID4 ne "r" || $ID5 ne "z" || $ID6 ne "x" || $ID7 ne "d"){ print "This transaction is closed.1
"; exit; } if ($bidID eq "" || $custID eq "" || $seller eq "" || $itemNUM eq "" || $rps eq "" || $late eq "" || $local eq "" || $random eq ""){ print "This transaction is closed.2
"; exit; } #my $tempfile="/home/www/gscat.com/temp/" . $bidID . "bidtempfile.txt"; #my $tempfile="/home/www/gscat.com/" . $custID . "tempfile.txt"; #Find customer. #open (SEM, ">$biddersLOCK"); #flock (SEM, LOCK_EX); open (BIDDERS,$bidders); while ($line = ){ ($mag, $line) = split (/\|/, $line); my @LGI = split(/\*/, $line); if ($LGI[0] eq $custID){ $custLINE = $line; $custEMAIL = $LGI[9]; $custNAME = $LGI[1]; $custUSERNAME = $LGI[10]; $custPASSWORD = $LGI[11]; $custADDRESS1 = $LGI[2]; $custADDRESS2 = $LGI[3]; $custCITY = $LGI[4]; $custSTATE = $LGI[5]; $custZIP = $LGI[6]; $custNATION = $LGI[7]; $foundCUST = 1; goto m1; } } m1: close BIDDERS; #close SEM; if($foundCUST != 1){ print "
This transaction is closed. 3
"; exit; } if ($local == 1){ $custLOCATION = $ENV{"REMOTE_ADDR"}; my $custLOC = $custLOCATION; my $SAFEchar = "0-9."; $custLOC =~ s/[^$SAFEchar]//g; if ($custLOC ne $custLOCATION){ print "
Data transfer problem. Please Log in. 1A.
"; exit; } #pass $custID and $custLOCATION. #----------------------------- #Is customer in login file? my $found="0"; my $checkfile = "/home/www/gscat.com/IiPfmMReg7/checkLOGIN.txt"; my $checkfileLOCK = "/home/www/gscat.com/sem/checkLOGIN.sem"; my $check; my $CID; my $cl; my @exit; my $OK; my $line2; #open (SEM, ">$loginfileLOCK"); #flock (SEM, LOCK_EX); open (LOGIN,$loginfile); while ($line2 = ){ my @LGK = split(/\*/, $line2); if ($LGK[0] eq $custID){ $found = "1"; goto ex1; } } ex1: close LOGIN; #close SEM; #Did customer log in from same place? if ($found eq "1"){ #open (SEM, ">$checkfileLOCK"); #flock (SEM, LOCK_EX); open(CHECK,$checkfile); while ($check = ){ my @exit = split(/\*/,$check); $CID = $exit[0]; $cl = $exit[1]; if($CID eq $custID){ if($cl eq $custLOCATION){ $OK="OK"; goto ab1; }else{ $custID=""; print "
Error 51.A
"; #Log in exit; } } } ab1: close CHECK; #close SEM; }else{ $custID=""; print "
Error 51.B
"; exit; } if ($found eq "1" && $OK eq "OK"){ my $GOODcust = 1; }else{ print "
Please log in.22
"; #print <Log in #ENDHTML exit; } } #Find item from itemfile. #open (SEM, ">$itemfileLOCK"); #flock (SEM, LOCK_EX); open (ITEMS, $itemfile); while ($line = ){ @unit = split(/\*/, $line); if ($unit[0] eq "HOLD"){ if ($unit[1] eq $itemNUM){ $seller = $unit[2]; $itemLINE = $line; $itemCODE = $unit[3]; $itemQUANT = $unit[4]; $itemTITLE = $unit[5]; $itemPRICE = $unit[7]; $itemMINIMUM = $unit[8]; $foundITEM = 1; goto mm2; } } } mm2: close ITEMS; #close SEM; if ($foundITEM != 1){ print "
This transaction is closed. 4
"; exit; } if ($itemQUANT ne "1"){ $asd = "[" . $itemQUANT . "]"; $asdcust = " . . [ $itemQUANT available ] "; $asdsold = " . . [ $itemQUANT ] "; }else{ $asd = ""; $asdcust = ""; $asdsold = ""; } #Find seller. #open (SEM, ">$sellersLOCK"); #flock (SEM, LOCK_EX); open (SELLERS,$sellers); while ($line = ){ ($mag, $line) = split (/\|/, $line); my @LGK = split (/\*/, $line); if ($LGK[0] eq $seller){ $sellerEMAIL = $LGK[9]; $sellerNAME = $LGK[1]; $sellersline = $line; $gotseller = 1; goto nn4; } } nn4: close SELLERS; close SEM; if ($gotseller != 1){ print "
This transaction is closed.5

"; exit; } #Find Bid on record. #open (SEM, ">$bidrecordLOCK"); #flock (SEM, LOCK_EX); open (BID,$bidrecord); while ($line = ){ my @LLL = split (/\*/, $line); #print "$custNAME
"; #print "$sellerNAME
"; #print "$itemCODE
"; if ($LLL[0] eq $bidID){ if ($LLL[2] eq $custUSERNAME && $LLL[4] eq $sellerNAME && $LLL[6] eq $itemCODE && $LLL[11] eq $random){ $oldBIDline = $line; $gotbid = 1; $oldBIDactual = $LLL[8]; $finalBID = $oldBIDactual; $bidDATE = $LLL[9]; #$newitemPRICE =$oldBIDactual; goto zz1; }else{ print "This transaction is closed.6
"; exit; } } } zz1: close BID; #close SEM; if ($gotbid != 1){ print "
This transaction is closed. 7
"; exit; } ## $bidID . "*" . $custNAME . "*" . $sellerNAME . "*" . $itemCODE . "*"; #------------------------ # security done. #------------------------ WEBBID: if ($rps == 1 || $rps == 2){ #here WEBBID: if ($rps != 0 && $rps != 5){ #bidders WEBBID: if ($rps == 9 || $rps == 8) print "

Express Bidding.


"; if ($local == 0){ print "Home Page --- "; print "Login


"; }else{ print "Return to bidding --- "; print "Return to User's Page --- "; print "Logout


"; } #print "Home Page --- "; #print "Login


"; if ($rps == 2){ #corroborate bid $pass = "n=" . $bidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=0&z=1&x=" . $local . "&d=" . $random; print "



"; print "Hello $custNAME,

Congratulations. Seller has finally accepted your bid of \$ $oldBIDactual for:

$unit[5]$asdcust
. . . .Price(includes S\&H) - \$ $itemPRICE . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]

"; print "However, seller's acceptance of this offer came after the 24 hour time limit established by GScat policy. Therefore, your acceptance of your own bid is now optional. What do you want to do now?

I'm still happy with my latest bid of: \$ $oldBIDactual. (Includes shipping and handling)
Instead, I now want to bid: \$. (Will include shipping and handling)
I want to stop bidding on this item.

Please enter your GScat.com password:



Best Regards,
The GScat intermediary


\n"; #print "P.S. -- This message is intended for GScat members that are vividly aware of this transaction in progress. If you don't recognize this transaction or are confused by it for any reason, please do not respond to this message but instead go to the www.GScat.com website, log in and review this transaction under the Local Bidding header.

\n"; #print "NOTICE -- GScat will NEVER ask you for any information in an email except a radio button choice and a price.


\n"; print "



"; } if ($rps == 1){ #counter bid if ($itemMINIMUM <= $oldBIDactual){ $pass = "n=" . $bidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=0&z=0&x=" . $local . "&d=" . $random; }else{ $pass = "n=" . $bidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=5&z=0&x=" . $local . "&d=" . $random; } #$pass = "n=" . $bidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=0&z=0&x=" . $local . "&d=" . $random; print "



"; print "Hello $custNAME,

Seller has made a counter offer of \$ $oldBIDactual for:

$unit[5]$asdcust
. . . .Price(includes S\&H) - \$ $itemPRICE . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]

You must reply within 24 hours of the posting of this bid or the seller will have the option of ending bidding with you. What do you want to do next:

"; print "
I accept the latest bid of \$ $oldBIDactual. (Includes shipping and handling.)
Instead, I bid: \$. (Will include shipping and handling.)
Stop bidding.

Please enter your GScat.com password:



Best Regards and have a great day,
The GScat intermediary


"; #print "P.S. -- This message is intended for GScat members that are vividly aware of this transaction in progress. If you don't recognize this transaction or are confused by it for any reason, please do not respond to this message but instead go to the www.GScat.com website, log in and review this transaction under the Local Bidding header.

\n"; #print "NOTICE -- GScat will NEVER ask you for any information in an email except a radio button choice and a price.


\n"; print "



"; } #print "Home Page --- "; #print "Login
"; if ($local == 0){ print "Home Page --- "; print "Login
"; }else{ print "Return to bidding --- "; print "Return to User's Page --- "; print "Logout
"; } print "

"; exit; } read(STDIN, $datarow, $ENV{'CONTENT_LENGTH'}); $datarow =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; #$datarow =~ tr/[\*\|\\\/]/-/; #print "data -- ", $datarow,"
"; @bids = split (/&/,$datarow); ($n, $acceptbid) = split (/=/,$bids[0]); ($nn, $otherbid) = split (/=/,$bids[1]); ($nnn, $inputPASSWORD) = split (/=/,$bids[2]); #if($n eq "" && $nn eq "" && $nnn eq ""){ #}else{ # print "
Data transfer problem.22
"; # exit; #} $CustName = $inputPASSWORD; $inputPASSWORD = encrypt(); #Recover the bid. ---------------------------- #---------------------------- if ($otherbid ne "endbid"){ my $RAWotherbid = $otherbid; $otherbid =~ s/[^0-9.]//g; if ($RAWotherbid ne $otherbid){ print "
Bids can be placed using numerals only (with decimal point). Please bid again.
"; exit; } if ($rps == 5){ $lowbidexception = 1; #print "low bid here.
"; } if ($acceptbid eq $oldBIDactual){ $BIDactual = $oldBIDactual; }elsif ($acceptbid eq "otherbid"){ if ($otherbid ne ""){ $BIDactual = $otherbid; }else{ print "
Please click back and make a bid.
"; exit; } } if ($BIDactual eq ""){ print "
Please click back and make a selection by choosing a radio button.
"; exit; #my $IDletter = substr($bidID, 0, 1); #if ($IDletter eq "L"){ # $rps = 2; # goto WEBBID; #}else{ # $rps = 1; # goto WEBBID; #} #blank bid comes to here. } #print "Bid actual - \$ ", $BIDactual, ".

"; $BIDactual = sprintf ("%.2f",$BIDactual); if ($inputPASSWORD ne $custPASSWORD && $local == 0){ print "
Your password is incorrect. Please click back and re-enter.
"; exit; } #print "
END
"; #exit; }else{ if ($inputPASSWORD ne $custPASSWORD && $local == 0){ print "
Your password is incorrect. Please click back and re-enter.
"; exit; } #-------Bidder chooses to closeout bidding-----------------. #//////////////////////// print "

End of Bidding.


"; if ($local == 0){ print "Home Page --- "; print "Login


"; }else{ print "Return to bidding --- "; print "Return to User's Page --- "; print "Logout


"; } print "



"; print "To: $custEMAIL
"; print "From: intermediary\@GScat.com
"; print "Subject: GScat: End of bidding at your request.

"; print "Hello $custNAME,

As per your request, you have ended bidding with the seller for:

$unit[5]$asdcust
. . . .Price(\+S\&H) - \$ $itemPRICE . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]

Since you the bidder ended the bidding, if you choose, you may still bid on this item again.

Best Regards,
The GScat intermediary
(email receipt to follow.)


"; print "



"; if ($local == 0){ print "Home Page --- "; print "Login
"; }else{ print "Return to bidding --- "; print "Return to User's Page --- "; print "Logout
"; } print "

"; #\\\\\\\\\\\\\\\\\\\\\\\\\\\ print "
"; #De-activate (remove) bid in bid record. $z = 0; my $tmp = File::Temp->new(); my $tempfile = $tmp->filename; open (SEM, ">$bidrecordLOCK"); flock (SEM, LOCK_EX); open (BID,$bidrecord); open (TEMP,">>$tempfile"); while ($line = ){ if ($z == 0){ my @LLL = split (/\*/, $line); if ($LLL[0] eq $bidID){ open (SEM2, ">$bidarchiveLOCK"); flock (SEM2, LOCK_EX); open (ARCHIVE, ">>$bidarchive"); print ARCHIVE "OLD*" . $line; close ARCHIVE; close SEM2; $z = 1; }else{ print TEMP $line; } }else{ print TEMP $line; } } close TEMP; close BID; copy ($tempfile,$bidrecord); close SEM; #-------record end of bidding by bidder--------- $doublecheck = "bidder*" . $bidID . "*" . $custID. "*" . $custUSERNAME . "*" . $seller . "*" . $sellerNAME . "*" . $itemNUM . "*" . $itemCODE . "*". $itemQUANT . "*" . $finalBID . "*" . localtime . "*" . $reps . "*" . $random . "*"; open (SEM, ">$biddingendedLOCK"); flock (SEM, LOCK_EX); open (HAND, ">>$biddingended"); print HAND $doublecheck,"*\n"; close HAND; close SEM; #------------------------------------- #Delete bidder from bidders' list. $z = 0; $tmp = File::Temp->new(); $tempfile = $tmp->filename; open (SEM, ">$biddersLOCK"); flock (SEM, LOCK_EX); open (BIDDERS,$bidders); open (TEMP, ">>$tempfile"); while ($line = ){ if ($z == 0){ ($mag, $line) = split (/\|/, $line); my @LGI = split(/\*/, $line); if ($LGI[0] ne $custID){ print TEMP $mag . "|" . $line; }else{ if ($mag == 1){ }else{ $mag = $mag - 1; print TEMP $mag . "|" . $line; $z = 1; } } }else{ print TEMP $line; } } close BIDDERS; close TEMP; copy ($tempfile, $bidders); close SEM; #Un Hold the item. $z = 0; $tmp = File::Temp->new(); $tempfile = $tmp->filename; open (SEM, ">$itemfileLOCK"); flock (SEM, LOCK_EX); open (ITEM, $itemfile); open (TEMP, ">>$tempfile"); while ($line = ){ if ($z == 0){ @KLP = split (/\*/,$line); if ($KLP[0] eq "HOLD"){ if ($KLP[1] eq $itemNUM){ for ($i = 1; $i <= 12; $i++) { print TEMP $KLP[$i] . "*"; } print TEMP "\n"; $z = 1; }else{ print TEMP $line; } }else{ print TEMP $line; } }else{ print TEMP $line; } } close TEMP; close ITEM; copy ($tempfile,$itemfile); close SEM; #print <


#Go to user's page. --- #Logout
#ENDHTML #-------Stop bidding from bidder---receipt----------- open (MAIL, "|$sendmail"); print MAIL "To: " . $custEMAIL . "\n"; print MAIL "Reply-to: " . $gscati . "\n"; print MAIL "From: " . $gscati . "\n"; print MAIL "Subject: GScat RECEIPT: End of bidding at your request.\n"; print MAIL "Content-type: text/html\n\n"; print MAIL "Hello $custNAME,

As per your request, you have ended bidding with the seller for:

$unit[5]$asdcust
. . . .Price(\+S\&H) - \$ $itemPRICE . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]

Since you the bidder ended the bidding, if you choose, you may still bid on this item again.

Best Regards,
The GScat intermediary

\n"; close MAIL; #--------------------------------------------------- #---End-bidding------------Email to seller------------ open (MAIL, "|$sendmail"); print MAIL "To: " . $sellerEMAIL . "\n"; print MAIL "Reply-to: " . $gscati . "\n"; print MAIL "From: " . $gscati . "\n"; print MAIL "Subject: GScat: Bidding ended for $itemCODE$asd.\n"; print MAIL "Content-type: text/html\n\n"; print MAIL "

Hello $sellerNAME,

$custUSERNAME has chosen to stop bidding for $itemCODE$asd. The item is now available to other customers for selection and bidding. Since $custUSERNAME stopped the bidding, he/she may choose to bid on this item again.

Best Regards,
The GScat intermediary

\n"; close MAIL; #------------------------------------------------- exit; #No lost item here since Bidder closed the bidding. } #------------------------------ #Reject bids below minimum price. if($BIDactual < $itemMINIMUM && $lowbidexception == 0){ #$repsrecord my $clink = 0; my $zzz = 0; my $reps = 0; my $found = 0; my $tmp = File::Temp->new(); my $tempfile = $tmp->filename; open (SEM,$repsrecordLOCK); flock (SEM, LOCK_EX); open (TEMP, ">>$tempfile"); open (REPS,$repsrecord); while ($line = ){ if ($zzz == 0){ my @ADE = split (/\*/, $line); if ($ADE[0] == $custID){ $found = 1; foreach (@ADE){ if ($clink == 0){ print TEMP $_ . "*"; }else{ if ($_ ne ""){ if ($_ eq $itemNUM){ $reps = $reps + 1; } print TEMP $_ . "*"; }else{ print TEMP $itemNUM . "**\n"; goto www5; } } $clink = 1; } www5: #continue. $zzz = 1; }else{ print TEMP $line; } }else{ print TEMP $line; } } close REPS; close TEMP; copy ($tempfile,$repsrecord); if ($found == 0){ open (REPS,">>$repsrecord"); print REPS $custID . "*" . $itemNUM . "**\n"; close REPS; } close SEM; $reps = $reps + 1; #$pass = "n=" . $OLDbidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=" . $reps . "&z=0&x=$local"; $pass = "n=" . $OLDbidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=0&z=0&x=$local" . "&d=" . $random; $pass1 = "n=" . $OLDbidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=1&z=0&x=$local" . "&d=" . $random; #--------------------------- #get bid number for this bid. $tmp = File::Temp->new(); $tempfile = $tmp->filename; open (SEM, ">$bidnumberLOCK"); flock (SEM, LOCK_EX); open (INC, ">>$tempfile"); open (INCREMENT, $bidnumber); $bidID = ; print INC $bidID+1; close INC; close INCREMENT; copy ($tempfile,$bidnumber); close SEM; #--------------------------- $doublecheck = $bidID . "*" . $custID. "*" . $custUSERNAME . "*" . $seller . "*" . $itemNUM . "*" . $itemCODE . "*". $itemQUANT . "*\$" . $itemPRICE . "*\$" . $itemMINIMUM . "*&" . $BIDactual . "*" . localtime . "*" . $reps . "*"; #$doublecheck = $bidID . "*" . $custID. "*" . $custNAME . "*" . $seller . "*" . $sellerNAME . "*" . $itemNUM . "*" . $itemCODE . "*". $itemQUANT . "*" . $BIDactual . "*" . localtime . "*"; open (SEM, ">$lowbidsLOCK"); flock (SEM, LOCK_EX); open (HANDLE, ">>$lowbids"); print HANDLE $doublecheck,"*\n"; close HANDLE; close SEM; if ($reps < 3){ #print "reps = ", $reps; #//////////////////////// print "


Low Bid.


"; if ($local == 0){ print "Home Page --- "; print "Login

"; }else{ print "Return to bidding --- "; print "Return to User's Page --- "; print "Logout


"; } print "



"; print "
Hello $custNAME,

Your bid of \$ $BIDactual for:

"; print $unit[5],$asdcust; print "
. . . .Price(includes S\&H) - \$ ", $itemPRICE, " . . . . . . . Zip code - ", $unit[10],"
"; print " . . . . . ",$unit[9],"

"; print "is less than the minimum established by the seller.

Please feel free to try a higher bid. You may make a total of three low bids on this item.

"; #print <"; print " I accept the seller's latest offer: \$ $oldBIDactual. Includes shipping and handling.
"; print " Instead, I bid: \$"; print "
"; print " Stop bidding.

"; if ($local == 0){ print "
Please enter your GScat.com password:


"; } print "


"; #ENDHTML print "



"; if ($local == 0){ print "Home Page --- "; print "Login
"; }else{ print "Return to bidding --- "; print "Return to User's Page --- "; print "Logout
"; } print "

"; #\\\\\\\\\\\\\\\\\\\\\\\\\\\ exit; }else{ #////////////////////////// print "

End of Bidding.


"; if ($local == 0){ print "Home Page --- "; print "Login


"; }else{ print "Return to bidding --- "; print "Return to User's Page --- "; print "Logout


"; } print "



"; print "To: $custEMAIL
"; print "From: intermediary\@GScat.com
"; print "Subject: GScat: End of bidding due to three low bids.

"; print "Hello $custNAME,

Three of your bids for:

$unit[5]$asdcust
. . . .Price(\+S\&H) - \$ $itemPRICE . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]

have been lower than the seller's minimum.

Please feel free to bid on other items. You cannot bid on this item again.

Best Regards,
The GScat intermediary
(email receipt to follow.)


"; print "



"; if ($local == 0){ print "Home Page --- "; print "Login
"; }else{ print "Return to bidding --- "; print "Return to User's Page --- "; print "Logout
"; } print "

"; #\\\\\\\\\\\\\\\\\\\\\\\\\\\ print "
"; #-------End bidding due to Three low bids from bidder---receipt----------- open (MAIL, "|$sendmail"); print MAIL "To: " . $custEMAIL . "\n"; print MAIL "Reply-to: " . $gscati . "\n"; print MAIL "From: " . $gscati . "\n"; print MAIL "Subject: GScat RECEIPT: End of bidding due to three low bids.\n"; print MAIL "Content-type: text/html\n\n"; print MAIL "Hello $custNAME,

Three of your bids for:

$unit[5]$asdcust
. . . .Price(\+S\&H) - \$ $itemPRICE . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]

have been lower than the seller's minimum.

Please feel free to bid on another item. You cannot bid on this item again.

Best Regards,
The GScat intermediary

\n"; close MAIL; #---------------------------------------------------- #print "


"; #----------End bidding due to three low bids from bidder------------Email to seller------------ open (MAIL, "|$sendmail"); print MAIL "To: " . $sellerEMAIL . "\n"; print MAIL "Reply-to: " . $gscati . "\n"; print MAIL "From: " . $gscati . "\n"; print MAIL "Subject: GScat: Three low bids for $itemCODE$asd.\n"; print MAIL "Content-type: text/html\n\n"; print MAIL "

Hello $sellerNAME,

After making at least one bid above your selected minimum, $custUSERNAME has now made three bids below your selected minimum bid for $itemCODE$asd. This item is now available to other customers for selection and bidding. $custUSERNAME cannot bid on this item again.

Best Regards,
The GScat intermediary

\n"; close MAIL; #------------------------------------------------- #Un Hold the item after failed bidding. $z = 0; my $tmp = File::Temp->new(); my $tempfile = $tmp->filename; open (SEM, ">$itemfileLOCK"); flock (SEM, LOCK_EX); open (ITEM, $itemfile); open (TEMP, ">>$tempfile"); while ($line = ){ if ($z == 0){ @KLP = split (/\*/,$line); if ($KLP[0] eq "HOLD"){ if ($KLP[1] eq $itemNUM){ for ($i = 1; $i <= 12; $i++) { print TEMP $KLP[$i] . "*"; } print TEMP "\n"; $z = 1; }else{ print TEMP $line; } }else{ print TEMP $line; } }else{ print TEMP $line; } } close TEMP; close ITEM; copy ($tempfile,$itemfile); close SEM; #De-activate (remove) bid in bid record. $z = 0; $tmp = File::Temp->new(); $tempfile = $tmp->filename; open (SEM, ">$bidrecordLOCK"); flock (SEM, LOCK_EX); open (BID,$bidrecord); open (TEMP,">>$tempfile"); while ($line = ){ if ($z == 0){ my @LLL = split (/\*/, $line); if ($LLL[0] eq $OLDbidID){ open (SEM2, ">$bidarchiveLOCK"); flock (SEM2, LOCK_EX); open (ARCHIVE, ">>$bidarchive"); print ARCHIVE "OLD*" . $line; close ARCHIVE; close SEM2; $click = 1; }else{ print TEMP $line; } }else{ print TEMP $line; } } close TEMP; close BID; copy ($tempfile,$bidrecord); close SEM; #Delete bidder from bidders' file. $z = 0; $tmp = File::Temp->new(); $tempfile = $tmp->filename; open (SEM, ">$biddersLOCK"); flock (SEM, LOCK_EX); open (BIDDERS,$bidders); open (TEMP, ">>$tempfile"); while ($line = ){ if ($z == 0){ ($mag, $line) = split (/\|/, $line); my @LGI = split(/\*/, $line); if ($LGI[0] ne $custID){ print TEMP $mag . "|" . $line; }else{ if ($mag == 1){ }else{ $mag = $mag - 1; print TEMP $mag . "|" . $line; $z = 1; } } }else{ print TEMP $line; } } close BIDDERS; close TEMP; copy ($tempfile, $bidders); close SEM; #post lost item. $gotit = 0; $tmp = File::Temp->new(); $tempfile = $tmp->filename; open (SEM, ">$lostitemsLOCK"); flock (SEM, LOCK_EX); open (LOST, $lostitems); open (TEMP, ">>$tempfile"); while ($line = ){ if ($gotit == 0){ @ABC = split (/\*/,$line); if ($ABC[0] eq $custID) { foreach (@ABC){ if ($_ ne ""){ print TEMP $_ . "*"; }else{ print TEMP $itemNUM . "**\n"; $gotit = 1; goto po1; } } }else{ print TEMP $line; } }else{ print TEMP $line; } po1: #continue } close TEMP; close LOST; copy ($tempfile,$lostitems); if ($gotit == 0){ open (LOST, ">>$lostitems"); print LOST $custID . "*" . $itemNUM . "**\n"; close LOST; } close SEM; #print <

#Return to user's page.
#Logout
#ENDHTML exit; } } #NO HOLD ITEM NEEDED HERE. #$pass = "n=" . $bidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=" . $reps . "&z=0&x=0"; $pass = "n=" . $bidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=0&z=0&x=0" . "&d=" . $random; $pass1 = "n=" . $bidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=1&z=0&x=0" . "&d=" . $random; #print "

FIRST ", $pass; #print "
reps here -- ", $reps; $doublecheck = $bidID . "*" . $custID. "*" . $custUSERNAME . "*" . $seller . "*" . $sellerNAME . "*" . $itemNUM . "*" . $itemCODE . "*". $itemQUANT . "*&" . $BIDactual . "*" . localtime . "*" . $reps . "*" . $random . "*"; #$doublecheck = $bidID . "*" . $custID. "*" . $custNAME . "*" . $seller . "*" . $sellerNAME . "*" . $itemNUM . "*" . $itemCODE . "*". $BIDactual . "*" . localtime . "*"; if ($BIDactual >= $oldBIDactual){ #make this latest price. #Sale made. Send final email to buyer(bidder) needed also as receipt. if ($late eq "0"){ #/////////////////////////////// print "


Successful Bid and Purchase.


"; if ($local == 0){ print "Home Page --- "; print "Login


"; }else{ print "Return to bidding --- "; print "Return to User's Page --- "; print "Logout


"; } print "



"; print "To: $custEMAIL
"; print "From: intermediary\@GScat
"; print "Subject: GScat: Successful purchase for: \$ $oldBIDactual.

"; print "Hello $custNAME,

Thank you for purchasing:

$unit[5]$asdsold
. . . .Price(\+S\&H) - \$ $itemPRICE . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]

Because you accepted the counter bid of \$ $oldBIDactual, your bidding is complete. The seller has been notified of your purchase and has been provided with the contact/shipping information on record from your GScat registration. If you provided no address/shipping information, you will have to contact the seller to make special arrangements.

The seller's email address is: $sellerEMAIL.

You may use this address to complete the transaction. Please remember to post your opinion of this transaction when it is complete.

Best Regards and have a great day,
The GScat intermediary
(email receipt to follow.)


"; print "



"; if ($local == 0){ print "Home Page --- "; print "Login
"; }else{ print "Return to bidding --- "; print "Return to User's Page --- "; print "Logout
"; } print "

"; #\\\\\\\\\\\\\\\\\\\\\\\\\\\ print "
"; #---------Receipt email to bidder---------- open (MAIL, "|$sendmail"); print MAIL "To: " . $custEMAIL . "\n"; print MAIL "Reply-to: " . $gscati . "\n"; print MAIL "From: " . $gscati . "\n"; print MAIL "Subject: GScat RECEIPT: Successful purchase for: \$ $oldBIDactual.\n"; print MAIL "Content-type: text/html\n\n"; print MAIL "Hello $custNAME,

Thank you for purchasing:

$unit[5]$asdsold
. . . .Price(\+S\&H) - \$ ", $itemPRICE, " . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]

Because you accepted the counter bid of \$ $oldBIDactual (you may have bid more), your bidding is complete. The seller has been notified of your purchase and has been provided with the contact/shipping information on record from your GScat registration. If you provided no address/shipping information, you will have to contact the seller to make special arrangements.

The seller's email address is: $sellerEMAIL.

You may use this address to complete the transaction. Please remember to post your opinion of this transaction when it is complete.

Best Regards and have a great day,
The GScat intermediary

\n"; close MAIL; #---------------------------------- #print "


"; #----------Final email to seller------------ open (MAIL, "|$sendmail"); print MAIL "To: " . $sellerEMAIL . "\n"; print MAIL "Reply-to: " . $gscati . "\n"; print MAIL "From: " . $gscati . "\n"; print MAIL "Subject: GScat: $itemCODE$asd sold for \$ $oldBIDactual.\n"; print MAIL "Content-type: text/html\n\n"; print MAIL "Hello $sellerNAME,

Congratulations. $custUSERNAME purchased $itemCODE$asd on GScat for \$ $oldBIDactual, your most recent counterbid.

Contact/shipping information for $custUSERNAME is:

$custNAME
$custADDRESS1, $custADDRESS2
$custCITY, $custSTATE $custZIP
$custNATION

$custEMAIL

GScat provided the buyer with your email address only so that they can contact you and complete the transaction. Please contact the buyer if other arrangements are required. Please remember to post your opinion of this transaction when it is complete.

Best Regards and have a great day,
The GScat intermediary

\n"; close MAIL; #-------------------------------------- #$custUSERNAME }else{ #Include final emails for late acceptance by seller. #/////////////////////////////// print "

Successful Bid and Sale.


"; if ($local == 0){ print "Home Page --- "; print "Login


"; }else{ print "Return to bidding --- "; print "Return to User's Page --- "; print "Logout


"; } print "



"; print "To: $custEMAIL
"; print "From: intermediary\@GScat.com
"; print "Subject: GScat: Successful purchase for: \$ $oldBIDactual.

"; print "Hello $custNAME,

Thank you for purchasing:

$unit[5],$asdsold
. . . .Price(\+S\&H) - \$ $itemPRICE . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]

Because you corroborated your counter bid of \$ $oldBIDactual, your bidding is complete. The seller has been notified of your purchase and has been provided with the contact/shipping information on record from your GScat registration. If you provided no address/shipping information, you will have to contact the seller to make special arrangements.

The seller's email address is: $sellerEMAIL.

You may use this address to complete the transaction. Please remember to post your opinion of this transaction when it is complete.

Best Regards and have a great day,
The GScat intermediary
(email receipt to follow.)


"; print "



"; if ($local == 0){ print "Home Page --- "; print "Login
"; }else{ print "Return to bidding --- "; print "Return to User's Page --- "; print "Logout
"; } print "

"; #\\\\\\\\\\\\\\\\\\\\\\\\\\\ print "
"; #---------Receipt email to bidder---------- open (MAIL, "|$sendmail"); print MAIL "To: " . $custEMAIL . "\n"; print MAIL "Reply-to: " . $gscati . "\n"; print MAIL "From: " . $gscati . "\n"; print MAIL "Subject: GScat RECEIPT: Successful purchase for: \$ $oldBIDactual.\n"; print MAIL "Content-type: text/html\n\n"; print MAIL "Hello $custNAME,

Thank you for purchasing:

$unit[5]$asdcust
. . . .Price(\+S\&H) - \$ ", $itemPRICE, " . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]

Because you corroborated your counter bid of \$ $oldBIDactual your bidding is complete. The seller has been notified of your purchase and has been provided with the contact/shipping information on record from your GScat registration. If you provided no address/shipping information, you will have to contact the seller to make special arrangements.

The seller's email address is: $sellerEMAIL.

You may use this address to complete the transaction. Please remember to post your opinion of this transaction when it is complete.

Best Regards and have a great day,
The GScat intermediary

\n"; close MAIL; #---------------------------------- #print "


"; #----------Final email to seller------------ open (MAIL, "|$sendmail"); print MAIL "To: " . $sellerEMAIL . "\n"; print MAIL "Reply-to: " . $gscati . "\n"; print MAIL "From: " . $gscati . "\n"; print MAIL "Subject: GScat: $itemCODE$asd sold for: \$ $oldBIDactual.\n"; print MAIL "Content-type: text/html\n\n"; print MAIL "Hello $sellerNAME,

Due to corroboration by $custUSERNAME, he/she purchased $itemCODE$asd on GScat for \$ $oldBIDactual, $custUSERNAME's most recent counterbid that you accepted late.

Contact/shipping information for $custUSERNAME is:

$custNAME
$custADDRESS1, $custADDRESS2
$custCITY, $custSTATE $custZIP
$custNATION

$custEMAIL

GScat provided $custUSERNAME with your email address only so that he/she can complete the transaction. Please contact the buyer if other arrangements are required. Please remember to post your opinion of this transaction when it is complete.

Best Regards and have a great day,
The GScat intermediary

\n"; close MAIL; #-------------------------------------- } #Sale made. Remove item from item log. With HOLD label. Remove photo. $z = 0; my $tmp = File::Temp->new(); my $tempfile = $tmp->filename; open (SEM, ">$itemfileLOCK"); flock (SEM, LOCK_EX); open (TEMP,">>$tempfile"); open (ITEMS,$itemfile); while ($line = ){ if ($z == 0){ my @XXZ = split(/\*/,$line); if ($XXZ[0] eq "HOLD"){ if ($XXZ[1] eq $itemNUM){ $mag = $XXZ[4]; open (SOLD, ">>$solditems"); print SOLD $line; close SOLD; $z = 1; if ($XXZ[11] ne "" && $mag == 1){ my $SAFEcharacters = "a-zA-Z0-9_.-"; my $photoID = $XXZ[11]; #Untaint image filename. if ( $photoID =~ /^([$SAFEcharacters]+)$/ ){ $photoID = $1; }else{ die "Filename contains invalid characters."; } my $oldHOME = "/home/www/gscat.com/images/$custID/" . $photoID; unlink($oldHOME); } if ($mag > 1){ $XXZ[4] = $mag - 1; for ($i = 1; $i <= 13; $i++) { if ($i < 13){ print TEMP $XXZ[$i] . "*"; }else{ print TEMP $XXZ[$i]; } } }else{ $itemend = 1; } }else{ print TEMP $line; } }else{ print TEMP $line; } }else{ print TEMP $line; } } close ITEMS; close TEMP; copy ($tempfile,$itemfile); close SEM; #Sale made. Send bid to accepted bids file. $doublecheck = $bidID . "*" . $custID. "*" . $custUSERNAME . "*" . $seller . "*" . $sellerNAME . "*" . $itemNUM . "*" . $itemCODE . "*". $itemQUANT . "*" . $oldBIDactual . "*" . localtime . "*" . $reps . "*" . $random . "*"; #my $doublecheck = $bidID . "*" . $custID. "*" . $custNAME . "*" . $seller . "*" . $sellerNAME . "*" . $itemNUM . "*" . $itemCODE . "*". $BIDactual . "*" . localtime . "*"; #Accepted bid not stored with all other bids in bids record. open (SEM, ">$bidsacceptedLOCK"); flock (SEM, LOCK_EX); open (HAND, ">>$bidsaccepted"); print HAND $doublecheck,"*\n"; close HAND; close SEM; #De-activate bid in bid record for. $click = 0; $tmp = File::Temp->new(); $tempfile = $tmp->filename; open (SEM, ">$bidrecordLOCK"); flock (SEM, LOCK_EX); open (BID,$bidrecord); open (TEMP,">>$tempfile"); while ($line = ){ if ($click == 0){ my @LLL = split (/\*/, $line); if ($LLL[0] eq $OLDbidID){ open (SEM2, ">$bidarchiveLOCK"); flock (SEM2, LOCK_EX); open (ARCHIVE, ">>$bidarchive"); print ARCHIVE "OLD*" . $line; close ARCHIVE; close SEM2; $click = 1; }else{ print TEMP $line; } }else{ print TEMP $line; } } close TEMP; close BID; copy ($tempfile,$bidrecord); close SEM; #Delete one seller listing from seller's list. $click = 0; $tmp = File::Temp->new(); $tempfile = $tmp->filename; open (SEM, ">$sellersLOCK"); flock (SEM, LOCK_EX); open (TEMP,">>$tempfile"); open (SELL,$sellers); while ($line = ){ if ($click == 0){ ($mag, $line) = split (/\|/, $line); my @XXY = split(/\*/,$line); if ($XXY[0] eq $seller){ if ($mag == 1){ }else{ $mag = $mag - 1; print TEMP $mag . "|" . $line; $click = 1; } }else{ print TEMP $mag . "|" . $line; } }else{ print TEMP $line; } } close TEMP; close SELL; copy ($tempfile,$sellers); close SEM; #Sale made. Delete one bidder from bidder's list. $click = 0; $tmp = File::Temp->new(); $tempfile = $tmp->filename; open (SEM, ">$biddersLOCK"); flock (SEM, LOCK_EX); open (TEMP,">>$tempfile"); open (BIDS,$bidders); while ($line = ){ if ($click == 0){ ($mag, $line) = split (/\|/, $line); my @XXW = split(/\*/,$line); if ($XXW[0] eq $custID){ if ($mag == 1){ }else{ $mag = $mag - 1; print TEMP $mag . "|" . $line; $click = 1; } }else{ print TEMP $mag . "|" . $line; } }else{ print TEMP $line; } } close TEMP; close BIDS; copy ($tempfile,$bidders); close SEM; #if $itemend=1, Remove itemNUM from lostitems and repsrecord to save space. if ($itemend == 1){ #----------delete itemNUM from Lost Items. my $tmp = File::Temp->new(); my $tempfile = $tmp->filename; open (SEM, ">$lostitemsLOCK"); flock (SEM, LOCK_EX); open (LOST, $lostitems); open (TEMP, ">>$tempfile"); while ($line = ){ @ABC = split (/\*/,$line); my $junk = 0; foreach (@ABC){ if ($junk == 0){ print TEMP $_ . "*"; $junk = 1; }else{ if ($_ ne ""){ if ($_ ne $itemNUM){ print TEMP $_ . "*"; } }else{ print TEMP "*\n"; goto ttyu4; } } } ttyu4: #continue; } close TEMP; close LOST; copy ($tempfile,$lostitems); close SEM; #----------delete itemNUM from reps record. $tmp = File::Temp->new(); $tempfile = $tmp->filename; open (SEM,$repsrecordLOCK); flock (SEM, LOCK_EX); open (TEMP, ">>$tempfile"); open (REPS,$repsrecord); while ($line = ){ @ABC = split (/\*/,$line); my $junk = 0; foreach (@ABC){ if ($junk == 0){ print TEMP $_ . "*"; $junk = 1; }else{ if ($_ ne ""){ if ($_ ne $itemNUM){ print TEMP $_ . "*"; } }else{ print TEMP "*\n"; goto plok5; } } } plok5: #continue } close TEMP; close REPS; copy ($tempfile,$repsrecord); close SEM; } }else{ #De-activate bid in bid record for. $click = 0; my $tmp = File::Temp->new(); my $tempfile = $tmp->filename; open (SEM, ">$bidrecordLOCK"); flock (SEM, LOCK_EX); open (BID,$bidrecord); open (TEMP,">>$tempfile"); while ($line = ){ if ($click == 0){ my @LLL = split (/\*/, $line); if ($LLL[0] eq $OLDbidID){ open (SEM2, ">$bidarchiveLOCK"); flock (SEM2, LOCK_EX); open (ARCHIVE, ">>$bidarchive"); print ARCHIVE "OLD*" . $line; close ARCHIVE; close SEM2; $click = 1; }else{ print TEMP $line; } }else{ print TEMP $line; } } close TEMP; close BID; copy ($tempfile,$bidrecord); close SEM; #--------------------------- #get bid number for this bid. $tmp = File::Temp->new(); $tempfile = $tmp->filename; open (SEM, ">$bidnumberLOCK"); flock (SEM, LOCK_EX); open (INC, ">>$tempfile"); open (INCREMENT, $bidnumber); $bidID = ; print INC $bidID+1; close INC; close INCREMENT; copy ($tempfile,$bidnumber); close SEM; #?????????????????????? #open (SEM, ">$lowbidsLOCK"); #flock (SEM, LOCK_EX); #--------------------------- #Generate 10 string character string for security. my $limit = 0; my $randomletter; my @letters = ('A'..'Z','a'..'z','0'..'9'); my $total = @letters; my $random = ""; while ($limit < 10){ $randomletter = $letters[rand $total]; $random = $random . $randomletter; $limit = $limit + 1; } $doublecheck = $bidID . "*" . $custID. "*" . $custUSERNAME . "*" . $seller . "*" . $sellerNAME . "*" . $itemNUM . "*" . $itemCODE . "*". $itemQUANT . "*&" . $BIDactual . "*" . localtime . "*" . $reps . "*" . $random . "*"; #Next bid entry record. open (SEM, ">$bidrecordLOCK"); flock(SEM, LOCK_EX); open (HANDLE, ">>$bidrecord"); print HANDLE $doublecheck . "*\n"; close HANDLE; close SEM; #$pass = "n=" . $bidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=" . $reps . "&z=0&x=0"; $pass = "n=" . $bidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=0&z=0&x=0" . "&d=" . $random; $pass8 = "n=" . $bidID . "&b=" . $custID . "&s=" . $seller . "&m=" . $itemNUM . "&r=8&z=0&x=0" . "&d=" . $random; #////////////////////////////// print "

Continued Bidding.


"; if ($local == 0){ print "Home Page --- "; print "Login


"; }else{ print "Return to bidding --- "; print "Return to User's Page --- "; print "Logout


"; } print "



"; print "To: $custEMAIL
"; print "From: intermediary\@GScat.com
"; print "Subject: GScat: Counter bid received.

"; print "Hello $custNAME,

Thank you for bidding \$ $BIDactual for:

$unit[5]$asdcust
. . . .Price(includes S\&H) - \$ $unit[7] . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]

An email message has been sent to the seller of this item. GScat will contact you when the seller decides whether to accept your bid, reject your bidding or make a counter offer. The seller is given at least 24 hours from the time you posted your bid to decide but the item is not available to anyone else in that time period. If no response is received from the seller after 24 hours, your acceptance of your own bid becomes optional.

Best Regards and have a great day,
The GScat intermediary.
(email receipt to follow.)


"; print "



"; if ($local == 0){ print "Home Page --- "; print "Login
"; }else{ print "Return to bidding --- "; print "Return to User's Page --- "; print "Logout
"; } print "

"; #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ print "
"; #WORKS (changed with \n) #---------------Email receipt to bidder------------- open (MAIL, "|$sendmail"); print MAIL "To: " . $custEMAIL . "\n"; print MAIL "Reply-to: " . $gscati . "\n"; print MAIL "From: " . $gscati . "\n"; print MAIL "Subject: GScat RECEIPT: Counter bid received.\n"; print MAIL "Content-type: text/html\n\n"; print MAIL "Hello $custNAME,

Thank you for bidding \$ $BIDactual for:

$unit[5]$asdcust
. . . .Price(includes S\&H) - \$ $unit[7] . . . . . . . Zip code - $unit[10]
. . . . . $unit[9]

An email message has been sent to the seller of this item. GScat will contact you when the seller decides whether to accept your bid, reject your bidding or make a counter offer. The seller is given at least 24 hours from the time you posted your bid to decide but the item is not available to anyone else in that time period. If no response is received from the seller after 24 hours, your acceptance of your own bid becomes optional.

Best Regards and have a great day,
The GScat intermediary.
\n"; close MAIL; #----------------------- #print "


"; #Broken now. (changed with \n) #--------------------Email message to seller--------- open (MAIL, "|$sendmail"); print MAIL "To: " . $sellerEMAIL . "\n"; print MAIL "Reply-to: " . $gscati . "\n"; print MAIL "From: " . $gscati . "\n"; print MAIL "Subject: GScat: Counter bid for $itemCODE$asd.\n"; print MAIL "Content-type: text/html\n\n"; print MAIL "Hello $sellerNAME,

You have received a counter bid for $itemCODE$asd of \$ $BIDactual from $custUSERNAME. You asked for \$ $itemPRICE and a minimum bid of \$ $itemMINIMUM. You must respond within 24 hours from the time the bidder posted his/her bid or the bidder need not honor his/her own bid.

"; print MAIL "You may log on to the GScat.com Marketplace to respond to this bid (select the 'Local Bidding' link on the User's Page) or click below for GScat.com Express Bidding.

GScat.com Express Bidding


Best Regards and have a great day,
The GScat intermediary

\n"; #print MAIL "P.S. -- This message is intended for GScat members that are vividly aware of this transaction in progress. If you don't recognize this transaction or are confused by it for any reason, please do not respond to this message but instead go to the www.GScat.com website, log in and review this transaction under the Local Bidding header.

"; #print MAIL "NOTICE -- GScat will NEVER ask you for any information in an email except a radio button choice and price.

\n"; close MAIL; #------------------------------------------------- } exit; sub encrypt(){ #my $RegisterKEY = "78704035285550587773797924280260057777174581965208962778627919390535356193758845"; my $RegisterKEY = "31888979673984578252060512781162624156486021981835483654499149458158022304464579"; my $LRkey=length($RegisterKEY); my $Lreg = length($CustName); my $ii=0; my $jj=0; my $letter=""; my $number=0; my $ascsum=0; my $ascvalue; my $KEY = ""; my $divisor1; my $divisor2; for ($jj=1;$jj<=$Lreg;$jj++){ $ii = $jj; $divisor1 = int($ii/2); $divisor2 = $ii/2; if ($ii <= $LRkey - 7){ $letter = substr($CustName, $ii-1, 1); #40 $number = substr($RegisterKEY, $ii + 5, 1); $ascvalue = ord($letter); if ($ascvalue <= 80){ if ($divisor1 == $divisor2){ $ascsum = $ascvalue + $number; }else{ $ascsum = $ascvalue + (2 * $number); } }elsif ($ascvalue > 80){ if ($divisor1 == $divisor2){ $ascsum = $ascvalue - $number; }else{ $ascsum = $ascvalue - (2 * $number); } } if ($ascsum == 92){ #backslash $ascsum = $ascsum - (2 * $number); } if ($ascsum == 42){ #ampersand $ascsum = $ascsum + (4 * $number); } if ($ascsum == 124){ #vertical line. $ascsum = 75; } $KEY = $KEY . chr($ascsum); }else{ goto tututu; } } #print "$KEY
"; tututu: #continue. return $KEY; } __END__ print MAIL "Click here for website bidding.

";