spoke too soon
it works, but it always displays a server misconfiguration message, anyone know why? hes the page its comming from (try putting info in, it should give you a nice looking error page)
and here is the script...
[edit]uh...code doesn't seem to work...oh well
#!/usr/bin/perl -w
#------------------------------------------------------------------------------#
# #
# Script name: Match Scheduler #
# Discription: Refs register game between two teams #
# Last updated: 11/22/01 #
# #
#------------------------------------------------------------------------------#
#---------
# Password to add a match
#---------
$pw = 'le3t';
#----------
# Get form info
#----------
use CGI qw(:standard);
$ref = param("name");
$f_pw = param("pw");
$team1 = param("team1");
$team2 = param("team2");
$hour = param("hour");
$min = param("min");
$amp = param("amp");
#---------
# Check the ref and password
#---------
open(REFS, "
while ( {
if (!(/^$ref/) || $ref eq '') {
$message = 'Sorry, you must be a ref to schedule a match, if you are, make sure you typed in your name correctly';
&message;
}
}
close(REFS);
if ($f_pw ne $pw) {
$message = 'Password is incorrect, please try again';
&message;
} else {
&add;
}
sub add {
$match = join('|=|', $team1, $team2, $hour, $min, $amp, $ref);
open(MATCHES, ">>matches.txt") or die "Cannot open Match file for appending: $!";
print MATCHES "$match n";
close(MATHCES);
&message = "Match succesfully added, thanks $ref";
&message;
}
sub message {
print "Content-type: text/htmlnn";
print<
..:: Infantry Flagging League ::..
..:: Copyright :: Privacy Policy ::.. |
HTML
}
[ 11-22-2001: Message edited by: adam ]
[ 11-22-2001: Message edited by: Mark Badolato ]