Hi thankyou in advance if you can help me, I have this script below and there is a problem. The script shows all items over 1 bid so thats 2nd bid, in the bidding on items regardless to the "$alias" connections with the item for sale. Ive beleive its somthing to do with this section which is the part that works out if you are a bidder but not the highest bidder;

if ($#bids) { for (my $i = $#bids; $i > 1; $i = 1) { my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_b +id($bids[$i]); $time = sort ({ int $a <=> int $b } $time); my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_bid($bid +s[$#bids]); if (($form{'ALIAS'} ne $lastbid[0]) && ($time < $lastbid[3])) { print qq| <TR><TD ALIGN=CENTER width=15%><A HREF=$ENV{'SCRIPT_NAME'}\?cat +egory=$key\&item=$file><font size=2 color=red>$file</font></font></A> <br><A HREF=$ENV{'SCRIPT_NAME'}\?action=watchitems&ALIAS=$form{ +'ALIAS'}&CATEGORY=$key&WATCH=$file><font size=1 color=red>Watch This! +</font></a></TD> <TD ALIGN=CENTER width=42%><A HREF=$ENV{'SCRIPT_NAME'}\?categor +y=$key\&item=$file><font size=2 color=red>$title</font></A> </TD><TD ALIGN=CENTER width=10%><font size=2>$timeremain</font> +</TD> <TD ALIGN=CENTER width=10%><font size=2 color=red>$#bids</font> +</TD><TD ALIGN=CENTER width=13%><font size=2 color=red>OUTBID\!<BR>\$ +$lastbid[2]</font></TD>\n|; }} }

My values are correct and its showing the items that the user has got the high bid of correct. To break it down a little more i suspect this section is core to the problem;
if ($#bids) { for (my $i = $#bids; $i > 1; $i = 1) { my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_b +id($bids[$i]); $time = sort ({ int $a <=> int $b } $time); my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_bid($bid +s[$#bids]); if (($form{'ALIAS'} ne $lastbid[0]) && ($time < $lastbid[3])) {
Any advice will help Thankyou

######################################################### sub bidding { print "<p><TABLE BORDER=1 WIDTH=90% cellspacing=2 align=center> +\n"; print "<TR><TD ALIGN=CENTER COLSPAN=5><FONT SIZE=3><b>Items I'm + Bidding On</b></font></TD></TR>"; print "<TR><TD ALIGN=CENTER width=10% bgcolor=#E5E5E5><font siz +e=2>Item \#</font></TD><TD ALIGN=CENTER width=40% bgcolor=#E5E5E5><fo +nt size=2>Title</font></TD><TD ALIGN=CENTER width=20% bgcolor=#E5E5E5 +><font size=2>Closes</font></TD><TD ALIGN=CENTER width=10% bgcolor=#E +5E5E5><font size=2>Bids</font></TD><TD ALIGN=CENTER width=10% bgcolor +=#E5E5E5><font size=2>Current Bid</font></TD></TR>\n"; my $totalbuy; my $total_items = 0; my $total_bids = 0; my $gooditem; foreach my $key (sort keys %category) { opendir (THEDIR, "$config{'basepath'}$key") || &oops("Category +directory $key could not be opened."); my @allfiles = grep( -T, map{"$config{'basepath'}$key/$_"} sort + { int $a <=> int $b } readdir THEDIR ); closedir THEDIR; FILE: foreach my $file (@allfiles) { $file =~ s/^$config{'basepath'}$key\///; $file =~ s/\.dat$//; my ($title, $reserve, $inc, $desc, $image, $grabber, $catfeat, +$galfeat, $buyit, $bold, $dutch, $qty, $ship, $shipcost, $shipto, $pa +y0, $pay1, $pay2, $pay3, $pay4, $pay5, $pay6, $pay7, $pay8, @bids) = +&read_item_file($key,$file); if ($title ne '') { $form{'ALIAS'} = ucfirst(lc($form{'ALIAS'})); my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_b +id($bids[0]); my @firstbid = &read_bid($bids[0]); my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_b +id($bids[$#bids]); my @lastbid = &read_bid($bids[$#bids]); my @closetime = localtime($file); $closetime[4]++; my $timeremain = time_remain($file); my $willbuy = $bid if (($form{'ALIAS'} eq $lastbid[0]) && ($for +m{'ALIAS'} ne $firstbid[0]) && ($bid eq $lastbid[2]) && ($reserve == +0) || ($form{'ALIAS'} eq $lastbid[0]) && ($form{'ALIAS'} ne $firstbid +[0]) && ($bid eq $lastbid[2]) && ($reserve > 0) && ($bid >= $reserve) +); $totalbuy=($totalbuy + $willbuy); $totalbuy = &priceformat ($totalbuy); $total_items = ($total_items + ($title ne '')) if (($form{'ALIA +S'} eq $lastbid[0]) && ($form{'ALIAS'} ne $firstbid[0]) && ($bid eq $ +lastbid[2]) || ($form{'ALIAS'} eq $lastbid[0]) && ($form{'ALIAS'} ne +$firstbid[0]) && ($bid eq $lastbid[2]) && ($bid >= $reserve)); $total_bids = ($total_bids + ($#bids > 0)) if (($form{'ALIAS'} +eq $lastbid[0]) && ($form{'ALIAS'} ne $firstbid[0]) && ($bid eq $last +bid[2])); $gooditem = ($bid => $reserve) if (($form{'ALIAS'} eq $lastbid[ +0]) && ($form{'ALIAS'} ne $firstbid[0]) && ($bid eq $lastbid[2]) && ( +$reserve > 0) && ($bid => $reserve)); if (($form{'ALIAS'} ne $firstbid[0]) && ($form{'ALIAS'} eq $alias) +) { print "<TR><TD ALIGN=CENTER width=15%><A HREF=$ENV{'SCRIPT_NAME +'}\?category=$key\&item=$file><font size=2 color=green><b>$file</b></ +font></A>"; print "<br><A HREF=$ENV{'SCRIPT_NAME'}\?action=watchitems&ALIAS +=$form{'ALIAS'}&CATEGORY=$key&WATCH=$file><font size=1 color=red>Watc +h This!</font></a></TD>"; print "<TD ALIGN=CENTER width=42%><A HREF=$ENV{'SCRIPT_NAME'}\? +category=$key\&item=$file><font size=2 color=green><b>$title</b></fon +t></A>"; print "</TD><TD ALIGN=CENTER width=10%><font size=2>$timeremain +</font></TD>"; print "<TD ALIGN=CENTER width=10%><font size=2 color=green><b>$ +#bids</b></font></TD><TD ALIGN=CENTER width=13%><font size=2 color=gr +een><b>\$$lastbid[2]</b></font></TD>\n" if (($bid eq $lastbid[2]) && +($reserve == 0) && ($#bids > 0)); print "<TD ALIGN=CENTER width=10%><font size=2 color=green><b>$ +#bids</b></font></TD><TD ALIGN=CENTER width=13%><font size=2 color=gr +een><b>\$$lastbid[2]</b></font><br><font size=1 color=red>Reserve Not + Met</font></TD>\n" if (($bid eq $lastbid[2]) && ($reserve > 0) && ($ +bid < $reserve)); print "<TD ALIGN=CENTER width=10%><font size=2 color=green><b>$ +#bids</b></font></TD><TD ALIGN=CENTER width=13%><font size=2 color=gr +een><b>\$$lastbid[2]</b></font><br><font size=1 color=green>Reserve M +et</font></TD>\n" if (($bid eq $lastbid[2]) && ($reserve > 0) && ($bi +d >= $reserve)); } if ($#bids) { for (my $i = $#bids; $i > 1; $i = 1) { my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_b +id($bids[$i]); $time = sort ({ int $a <=> int $b } $time); my ($alias, $email, $bid, $time, $add1, $add2, $add3) = &read_bid($bid +s[$#bids]); if (($form{'ALIAS'} ne $lastbid[0]) && ($time < $lastbid[3])) { print qq| <TR><TD ALIGN=CENTER width=15%><A HREF=$ENV{'SCRIPT_NAME'}\?cat +egory=$key\&item=$file><font size=2 color=red>$file</font></font></A> <br><A HREF=$ENV{'SCRIPT_NAME'}\?action=watchitems&ALIAS=$form{ +'ALIAS'}&CATEGORY=$key&WATCH=$file><font size=1 color=red>Watch This! +</font></a></TD> <TD ALIGN=CENTER width=42%><A HREF=$ENV{'SCRIPT_NAME'}\?categor +y=$key\&item=$file><font size=2 color=red>$title</font></A> </TD><TD ALIGN=CENTER width=10%><font size=2>$timeremain</font> +</TD> <TD ALIGN=CENTER width=10%><font size=2 color=red>$#bids</font> +</TD><TD ALIGN=CENTER width=13%><font size=2 color=red>OUTBID\!<BR>\$ +$lastbid[2]</font></TD>\n|; }} }} }} if ($totalbuy == 0) { print "<TR><TD ALIGN=CENTER><FONT SIZE=3 COLOR=red>$total_items +</FONT></TD><TD ALIGN=CENTER></TD><TD ALIGN=CENTER></TD><TD ALIGN=CEN +TER><FONT SIZE=3 COLOR=red>$total_bids</FONT></TD>"; print "<TD ALIGN=CENTER><FONT SIZE=3 COLOR=red>$config{'currenc +y'}$totalbuy</FONT></TD></TR>"; } if ($totalbuy > 0) { print "<TR><TD ALIGN=CENTER COLSPAN=5><FONT SIZE=3>Total Curren +t Successful Bids</FONT></TD></TR>"; print "<TR><TD ALIGN=CENTER><FONT SIZE=3 COLOR=GREEN>$total_ite +ms</FONT></TD><TD ALIGN=CENTER></TD><TD ALIGN=CENTER></TD><TD ALIGN=C +ENTER><FONT SIZE=3 COLOR=GREEN>$total_bids</FONT></TD>"; print "<TD ALIGN=CENTER><FONT SIZE=3 COLOR=GREEN>$config{'curre +ncy'}$totalbuy</FONT></TD></TR>"; } print "</TABLE><br>"; }

READMORE tags added by Arunbear


In reply to everyauction script error bidding errors by simonwilliams

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.