Thanks Andy. I simplified the code, made a few changes, works OK now.
if ($in{'db'} eq 'links') { # Make sure we're editing links, not categories.
# Get the file from /pics if there is one.
if ($rec{'Imagename_1'}) { # Display image one.
$image_1 = qq|<tr><td align="right" valign="top" width="20%"><$font>Image 1:</font></td><td width="80%"><img src="$upload_directory_url/$rec{$db_key}/$rec{'Imagename_1'}" /></td></tr>\n
<tr><td align="right" valign="top" width="20%"><$font>Delete Image 1?</font></td><td width="80%"><input type="checkbox" name="delete_1" value="yes" /></td></tr>\n|;
}
if ($rec{'Imagename_2'}) { # Display image two
$image_2 = qq|<tr><td align="right" valign="top" width="20%"><$font>Image 2:</font></td><td width=80%><img src="$upload_directory_url/$rec{$db_key}/$rec{'Imagename_2'}" /></td></tr>\n
<tr><td align="right" valign="top" width="20%"><$font>Delete Image 2?</font></td><td width="80%"><input type="checkbox" name="delete_2" value=\"yes\" /></td></tr>\n|;
}
if ($rec{'Imagename_3'}) { # Display image three
$image_3 = qq|<tr><td align="right" valign="top" width="20%"><$font>Image 3:</font></td><td width="80%"><img src="$upload_directory_url/$rec{$db_key}/$rec{'Imagename_3'}" /></td></tr>\n
<tr><td align="right" valign="top" width="20%"><$font>Delete Image 3?</font></td><td width="80%"><input type="checkbox" name="delete_3" value="yes" /></td></tr>\n|;
}
}
# <<<
# >>> Image Upload Mod
$output .= $image_1;
$output .= $image_2;
$output .= $image_3;
# <<<
Leonard
aka PerlFlunkie
Code:
# >>> Image Upload mod if ($in{'db'} eq 'links') { # Make sure we're editing links, not categories.
# Get the file from /pics if there is one.
if ($rec{'Imagename_1'}) { # Display image one.
$image_1 = qq|<tr><td align="right" valign="top" width="20%"><$font>Image 1:</font></td><td width="80%"><img src="$upload_directory_url/$rec{$db_key}/$rec{'Imagename_1'}" /></td></tr>\n
<tr><td align="right" valign="top" width="20%"><$font>Delete Image 1?</font></td><td width="80%"><input type="checkbox" name="delete_1" value="yes" /></td></tr>\n|;
}
if ($rec{'Imagename_2'}) { # Display image two
$image_2 = qq|<tr><td align="right" valign="top" width="20%"><$font>Image 2:</font></td><td width=80%><img src="$upload_directory_url/$rec{$db_key}/$rec{'Imagename_2'}" /></td></tr>\n
<tr><td align="right" valign="top" width="20%"><$font>Delete Image 2?</font></td><td width="80%"><input type="checkbox" name="delete_2" value=\"yes\" /></td></tr>\n|;
}
if ($rec{'Imagename_3'}) { # Display image three
$image_3 = qq|<tr><td align="right" valign="top" width="20%"><$font>Image 3:</font></td><td width="80%"><img src="$upload_directory_url/$rec{$db_key}/$rec{'Imagename_3'}" /></td></tr>\n
<tr><td align="right" valign="top" width="20%"><$font>Delete Image 3?</font></td><td width="80%"><input type="checkbox" name="delete_3" value="yes" /></td></tr>\n|;
}
}
# <<<
Code:
# >>> Image Upload Mod
$output .= $image_1;
$output .= $image_2;
$output .= $image_3;
# <<<
Leonard
aka PerlFlunkie