libuska78:

I don't see anything obvious to cause the problem you're seeing. However, after looking over the code, I don't think your error is in that subroutine1. It's hard to check, though, as the code is hard to look at, due to all the repetition.

If you see the same thing happening over and over in your code, it's a sign that something's wrong. You don't want to do that, because it's hard to look over and be certain that you made the correct edit in each and every block. Instead, use a loop to do the work. That way, you can concentrate on getting the task correct with only a little loop overhead rather than copy and pasting the code over and over, and then making small hand edits to adjust filenames and such.

Here's a rework of your subroutine that outputs the same text as yours, but rather than using hardcoded variables $file1, $file2, ... $file12, $uploadfile1, ..., $uploadfile12, it uses two arrays: @files and @uploadfiles:

sub upload { if ($match){ print "<table align=center width=100% border=0 cellspacing=0 c +ellpadding=0>"; print "<tr><td align=center width=100%>"; print "<FORM ACTION=\"$config{'scripturl'}/cgi-bin/auction/auc +tion.cgi?action=uploaddone\&IMAGE1=$files[0]\" METHOD=POST>"; my $footer=''; for my $idx (0 .. $#files) { last if $idx > 11; ### Original code had 12 copies of the +same code... my $idx_n = $idx+1; print "<center><b><font face=arial size=2>Image file $idx_ +n:</b>: $files[$idx]</center>\n"; print "<center><font face=arial size=2>$uploadfiles[$idx] +<br><b>Upload Complete Image $idx_n.</b></font></center>\n"; print "<p><img src=$config{'imageuploadurl'}/$files[$idx]> +</p><hr width=80% size=1 color=$config{'bordercolor'}>\n"; $footer .= "<input type=hidden name=IMAGE$idx_n value=$fil +es[$idx]>"; if ($idx == 0) { ### Original code only created THUMB for first file... $footer .= "<input type=hidden name=THUMB$idx_n value= +$files[$idx]>"; } } print $footer; print "</td></tr></table>"; print "<center><p><font face=arial size=2>If the image(s) are +correct. Click \"Continue\".</font></center></p>"; print "<center><p><font face=arial size=2><font face=arial siz +e=2>If they are not correct, use your browsers back button to try aga +in.</font></center></p>"; print "<center><input type=submit value=\"Continue\"></center> +"; print "</form>"; } }

There are other cleanups you can make, but I stopped at rolling your code up into a loop.

...roboticus

Update: Added this footnote:

1: Unless the problem is related to the THUMB input field being missing from items 2 through 12.


In reply to Re: Uploading pictures - displays only 2 of 12 by roboticus
in thread Uploading pictures - displays only 2 of 12 by libuska78

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.