RandomGuy
07-16-2008, 05:58 AM
I just wrote a script for a bball tourney that we're throwing... the code is SUPER DUPER simple...
I have a question, how can I make it so a new entry does not overwrite the old one thats already in the html file. please dont mind my crude crude simple code :)
#!/usr/bin/perl -wT
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;
my $tname = param('Teamn1');
my @players;
push(@players,param("Player1"), param("Player2"),
param("Player3"), param("Player4"), param("Player5"));
my $cname = param('name1');
my $numbr = param('phon1');
open(OUT, ">../registrants.html")or &dienice("Couldn't
open output file: $!");
print header;
print start_html("BBall Tourney Registration");
print h2("Thank you for registering, Hope to see you soon");
print OUT "<b>Team Name:", $tname,
"</b> ";
my $i;
for ($i = 0; $i < 5; $i++) {
print OUT @players[$i], " ";
}
print OUT "<br> Contact: ", $cname, " ",
$numbr, "<br><br><br><br>";
close(OUT);
whenever i test it and register a new team, it will over write the previously registered team instead of just adding it underneath and making a nice list
I have a question, how can I make it so a new entry does not overwrite the old one thats already in the html file. please dont mind my crude crude simple code :)
#!/usr/bin/perl -wT
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;
my $tname = param('Teamn1');
my @players;
push(@players,param("Player1"), param("Player2"),
param("Player3"), param("Player4"), param("Player5"));
my $cname = param('name1');
my $numbr = param('phon1');
open(OUT, ">../registrants.html")or &dienice("Couldn't
open output file: $!");
print header;
print start_html("BBall Tourney Registration");
print h2("Thank you for registering, Hope to see you soon");
print OUT "<b>Team Name:", $tname,
"</b> ";
my $i;
for ($i = 0; $i < 5; $i++) {
print OUT @players[$i], " ";
}
print OUT "<br> Contact: ", $cname, " ",
$numbr, "<br><br><br><br>";
close(OUT);
whenever i test it and register a new team, it will over write the previously registered team instead of just adding it underneath and making a nice list