I think I'm close,...
I need the possibility for users, to delete a photo, so I add the following code in my 'html.pl':
Code:
if (($rec{'Foto'}) &&($rec{'Foto'} ne "http://")){
print qq|
<form action="$db_script_url" METHOD="POST">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">
<input type=hidden name="db_key" value="$db_key">
<INPUT TYPE="submit" VALUE="Verwijder foto" NAME="delete_foto">|; }
And also the following to the 'db.cgi':
Code:
sub delete_foto {
# --------------------------------------------------------
my($db_key);
$ALLOWED_EXT =~ s/\\.//g;
$ALLOWED_EXT =~ s/\$//g;
@extensions = split (/\Q|\E/o,$ALLOWED_EXT);
foreach $extension (@extensions) {
(-e "$SAVE_DIRECTORY/$in{$db_key}.$extension") && (unlink <$SAVE_DIRECTORY/$in{$db_key}.$extension> )
}
&html_delete_foto_success($in{$db_key});
}
but the value of $in{db_key} will not load, I think, when I replace the code in the script with this:
Code:
sub delete_foto {
# --------------------------------------------------------
unlink "/opt/guide/www.autorandstad.nl/foto/10.jpg";
&html_delete_foto_success($in{$db_key});
}
it will delete number 10, just like I will. What am I missing???