Gossamer Forum
Home : Products : Links 2.0 : Discussions :

adding an entry/add.cgi

Quote Reply
adding an entry/add.cgi
When I submit the add form that posts to add.cgi it just refreshes the page and loads the blank form again. I know the issue is with the following code since if I change if (keys %in != 0) { to if (keys %in == 0) { it attempts to process the form when I load it. So for some reason keys %in is always == 0, no matter what fields I have filled in on my form.

# We are processing the form.
if (keys %in != 0) {
&process_form;
}
# Otherwise we are displaying the form (in site_html.pl).
else {
if ($db_single_category) {
my %is_valid = map { $_ => 1 } &category_list;
$ENV{'HTTP_REFERER'} =~ s,/[^/]+\.[^/]+$,,;
$ENV{'HTTP_REFERER'} =~ m,$build_root_url/(.+?)/?$,;
$is_valid{$1} ? &site_html_add_form ($1) : &site_html_add_form ();
}
else {
&site_html_add_form ()
}
}

Any suggestions/help would be appreciated, let me know if you need more info. Thanks in advance
Subject Author Views Date
Thread adding an entry/add.cgi Johnny23 17265 Apr 26, 2012, 12:52 PM
Thread Re: [Johnny23] adding an entry/add.cgi
Andy 16874 Apr 27, 2012, 2:45 AM
Thread Re: [Andy] adding an entry/add.cgi
Johnny23 16867 Apr 28, 2012, 6:50 AM
Thread Re: [Johnny23] adding an entry/add.cgi
Andy 16868 Apr 28, 2012, 7:04 AM
Thread Re: [Andy] adding an entry/add.cgi
Johnny23 16853 Apr 28, 2012, 7:40 AM
Post Re: [Johnny23] adding an entry/add.cgi
Andy 16851 Apr 28, 2012, 10:01 AM
Post Re: [Johnny23] adding an entry/add.cgi
PerlFlunkie 16312 Aug 22, 2012, 9:10 PM