sub process_form {
# --------------------------------------------------------
my ($key, $status, $line, $output);
# Let's require a category selection
if ($in{'Category'} = "") {
&site_html_add_failure ("You did not select a category.");
return;
}
else {
$category = $in{'Category'};
}
Your original problem:
I just did a test on a clean install of Links2, and if I select "-" or no category, then submit, I get this comment on the error page:
--
There were the following errors trying to add your resource:
Category (Can not be left blank)
--
So, the code above should not be required, since the unaltered code requires a category selection. Remove or comment out the above code in your file, and try to add a link through the add page, without selecting a category, and let me know what happens.
Sometimes I forget to check the simple things first, and also how well the original script was written.
Leonard
aka PerlFlunkie
# --------------------------------------------------------
my ($key, $status, $line, $output);
# Let's require a category selection
if ($in{'Category'} = "") {
&site_html_add_failure ("You did not select a category.");
return;
}
else {
$category = $in{'Category'};
}
Your original problem:
Quote:
Finally, none of these SPAM submissions "choose" a particular category. They select the top category which is no category at all. Can I somehow require a category selection, thereby not allowing a non-category (denoted with a "-" line) selection?I just did a test on a clean install of Links2, and if I select "-" or no category, then submit, I get this comment on the error page:
--
There were the following errors trying to add your resource:
Category (Can not be left blank)
--
So, the code above should not be required, since the unaltered code requires a category selection. Remove or comment out the above code in your file, and try to add a link through the add page, without selecting a category, and let me know what happens.
Sometimes I forget to check the simple things first, and also how well the original script was written.
Leonard
aka PerlFlunkie