Hi everyone, Can anyone please tell me what's wrong with this code? When I try to submit the form, it just reloads the page. It never gets to the "sub addreport" Thanks so much.
#!/usr/bin/perl # Locate and load required files eval { # Get the script location (for UNIX and Windows) ($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location (for Windows) ($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Load files require "settings.cgi"; require "common.sub"; }; # Read the form &readform; &reportit; ########################### SUBROUTINES ########################### # Display new member registration form sub reportit { # Load common vocabulary require "$tmplpath/common.txt"; # Load Registration Form template require "$tmplpath/reportit.tmpl"; # Smut filter indicator $showsmutswitch = "<a href=\"javascript:popup('$scripturl/members.cgi?action=showsmut')\">$commonv oc[35]</a>$commonvoc[36]" if $badwords; # Registration Form $FORM_SUB = qq(<SCRIPT LANGUAGE="JavaScript"> <!-- Hide from non-JavaScript browsers function Check_Data() { if (!document.adform.name.value || !document.adform.email.value || !document.adform.title.value || !document.adform.description.value) { alert("$commonvoc[30]"); return false; } else { return true; } } function popup(url) { newwindow=window.open(url,'name','height=200,width=300,scrollbars'); if (window.focus) {newwindow.focus()} } // Stop hiding ---> </SCRIPT> <div align="center"> <h3><font face="$fontname" size="$fontsize"><b>$tempvoc[0]</b></font></h3> <form method="post" action="$scripturl/reportit.cgi" name="adform" onSubmit="return Check_Data();"> <input type="hidden" name="action" value="addreport"> <table width="$tablewidth" border="0" cellspacing="1" cellpadding="3"> <tr> <td bgcolor="$headcolor" colspan="2"><font face="$sfontname" size="$sfontsize">$tempvoc[1]</font></td> </tr> <tr bgcolor="$primcolor"> <td><font face="$fontname" size="$fontsize"><b>$commonvoc[66]*</b></font></td> <td> <input type="text" name="name" maxlength="35" size="30"> </td> </tr> <tr bgcolor="$seconcolor"> <td><font face="$fontname" size="$fontsize"><b>$commonvoc[67]*</b></font></td> <td> <input type="text" name="email" maxlength="50" size="30"> </td> </tr> <tr bgcolor="$seconcolor"> <td><font face="$fontname" size="$fontsize"><b>$commonvoc[68]*</b></font></td> <td bgcolor="$seconcolor"> <input type="text" name="title" maxlength="100" size="30"> </td> </tr> <tr bgcolor="$primcolor"> <td><font face="$fontname" size="$fontsize"><b>$commonvoc[69]*</b></font></td> <td> <textarea NAME="description" WRAP="virtual" ROWS="6" COLS="40"></textarea> </td> </tr> <tr> <td bgcolor="$headcolor" colspan="2"><font face="$sfontname" size="$sfontsize">$commonvoc[21] $showsmutswitch</font></td> </tr> </table> <br> <input type="submit" name="submit" value="$commonvoc[24]"> <input type="button" name="cancel" value="$commonvoc[26]" onClick="history.back()"> <br> </form> </div>); # Perform template substitutions $temphtml =~ s/\{FORM\}/$FORM_SUB/g; # Display the screen &showscreen; } # Add new member to the database sub addreport { # Check referring URL &urlcheck; # Check form fields if ($FORM{'name'} !~ /\S/) { push(@badfields, 3); } if ($FORM{'email'} !~ /[\w\-]+\@[\w\-]+\.[\w\-]+/) { push(@badfields, 4); } if ($FORM{'title'} !~ /\S/) { push(@badfields, 6); } if ($FORM{'description'} !~ /\S/) { push(@badfields, 7); } # Display errors, if any &formerror; # Block Checker &blocker($ENV{'REMOTE_ADDR'}, "IP Address", $FORM{'email'}, "E-Mail Address"); # Check for bad/rude words &smut_detect($FORM{'name'},$FORM{'email'},$FORM{'title'},$FORM{'description' }); # Strip html tags &htmlstrip($FORM{'name'},$FORM{'email'},$FORM{'title'},$FORM{'description'}) ; # Get current time $curtime = time(); # Add member to the waiting list open(RLIST,">>$membpath/reportit.cgi") || err("Could not update reportit.cgi: $!"); flock(RLIST,2); seek(RLIST,0,2); print RLIST "$ENV{'REMOTE_ADDR'}\t$curtime\t$FORM{'name'}\t$FORM{'email'}\t$FORM{'title' }\t$FORM{'description'}\n"; close(RLIST); # Notify administrator of new application if ($regadmin) { $msgtext = "$FORM{'name'} has just applied to register with your Top Sites script!\n". "-----------------------------------------------------------------------\n\n ". "Note: this message was generated by Top Sites script.\n". "You can turn this notification off by adjusting the script options.\n"; &sendmail($adminemail, $adminemail, "New Top Sites membership application!", $msgtext); } # Send Waiting Approval Message if ($appuseremail) { $appmsg =~ s/\[name\]/$FORM{'name'}/g; $appmsg =~ s/\[email\]/$FORM{'email'}/g; $appmsg =~ s/\[title\]/$FORM{'title'}/g; &sendmail($adminemail, $FORM{'email'}, $appsubject, $appmsg); } # Show Success Screen &confirm(14,8,"$scripturl/index.cgi"); } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]