sure
umm...
here
http://www.footballjoint.com/Draft/team1.html
(if ya enter info you'll get a 500 error)
I took Matt's free links script and stripped the (a href) tags out of the script so it won't post values as a link
added in some html table and refresh tags to the html form page and...that's about it
after I removed those, I used an <li>(orderred list) tag as my counter instead of <a href like he did. But I'd swear it's 90-95% the very very same script. The 500 error is solely caused by that line. Everything is kewl otherwise.
And thanks for your time
here's the code:
# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Split the name-value pairs
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<([^>]|\n)*>//g;
$value =~ s/<//g;
$value =~ s/>//g;
$FORM{$name} = $value;
}
if (!($FORM{'title'})) {
&no_title;
}
# Enter our tags and sections into an associative array
%sections = ("team1","TEAM1","team2","TEAM2","team3","TEAM3",
"team4","TEAM4","team5","TEAM5","team6","TEAM6",
"team7","TEAM7","team8","TEAM8","team9","TEAM9",
"team10","TEAM10","team11","TEAM11","team12","TEAM12");
# Suck previous link file into one big string
open(FILE,"$filename");
@lines = <FILE>;
close(FILE);
$i=1;
foreach $line (@lines) {
if ($line =~ /\<li([^]+)([^]+)/) {
if ($FORM{'url'} eq $1) {
&repeat_url;
}
$i++;
}
}
# Open Link File to Output
open (FILE,">$filename");
foreach $line (@lines) { # For every line in our data
if ($line =~ /<!--time-->/) {
@months = ('January','February','March','April','May','June',
'July','August','September','October','November','December');
@days = ('Sunday','Monday','Tuesday','Wednesday','Thursday',
'Friday','Saturday');
($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6];
if ($sec < 10) { $sec = "0$sec"; }
if ($min < 10) { $min = "0$min"; }
if ($hour < 10) { $hour = "0$hour"; }
if ($mday < 10) { $mday = "0$mday"; }
$year += 1900;
$date = "on $days[$wday], $months[$mon] $mday, $year at $hour:$min:$sec";
print FILE "<!--time--><b>Last player was selected $date</b>Central<hr>\n";
}
elsif ($line =~ /<!--number-->/) {
print FILE "<!--number--><b>There have been <i>$i</i> players selected ";
print FILE "</b><br>\n";
}
else {
print FILE $line;
}
foreach $tag ( keys %sections) { # For every tag
if ( ($FORM{'section'} eq $sections{$tag}) &&
($line =~ /<!--$tag-->/) ) {
print FILE "<li type\"1\">$FORM{'title'} <font color=white><i>$FORM{'url'}</i></font>\n";
}
}
}
close (FILE);
# Return Link File
print "Location: $linksurl\n\n";
if ($database ne '') {
open (DATABASE,">>$database");
print DATABASE "$FORM{'url'}\n";
close(DATABASE);
}
sub no_url {
print "Content-type: text/html\n\n";
print "<html><head><title>ERROR: No Team enterred</title></head>\n";
print "<body bgcolor=#FFFFFF text=#000000><center>";
print "<h1>No Team enterred</h1></center>\n";
print "You forgot to enter the team this player plays for";
print "Your post was invalid.<p>\n";
print "<form method=POST action=\"$linkscgi\">\n";
print "<input type=hidden name=\"title\" value=\"$FORM{'title'}\">\n";
print "<input type=hidden name=\"section\"";
print "value=\"$FORM{'section'}\">\n";
print "Team: <input type=text name=\"url\" size=30><p>\n";
print "<input type=submit> * <input type=reset>\n";
print "<hr>\n";
print "<a href=\"$linksurl\">$linkstitle</a>\n";
print "</form></body></html>\n";
exit;
}
sub no_title {
print "Content-type: text/html\n\n";
print "<html><head><title>ERROR: No Player Selected</title></head>\n";
print "<body bgcolor=#FFFFFF text=#000000><center>";
print "<h1>No Player selected</h1></center>\n";
print "You forgot to enter a player that you wanted";
print "<p>\n";
print "<form method=POST action=\"$linkscgi\">\n";
print "<input type=hidden name=\"url\" value=\"$FORM{'url'}\">\n";
print "<input type=hidden name=\"section\"";
print "value=\"$FORM{'section'}\">\n";
print "Player: <input type=text name=\"title\" size=30><p>\n";
print "<input type=submit> * <input type=reset>\n";
print "<hr>\n";
print "<a href=\"$linksurl\">$linkstitle</a>\n";
print "</form></body></html>\n";
exit;
}
sub repeat_url {
print "Content-type: text/html\n\n";
print "<html><head><title>ERROR: Repeat URL</title></head>\n";
print "<body bgcolor=#FFFFFF text=#000000><center><h1>Repeat URL</h1></center>\n";
print "Sorry, this URL is already in the Free For All Link Page.\n";
print "You cannot add this URL to it again. Sorry.<p>\n";
print "<a href=\"$linksurl\">$linkstitle</a>";
print "</body></html>\n";
exit;
}