From e49c027eb9479fb64800142a53f5d5dfe0d290cf Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Thu, 17 Feb 2005 19:35:02 +0000 Subject: [PATCH] Add backend for adding players. --- html/do-add-player.pl | 20 ++++++++++++++++++++ html/templates/registration.tmpl | 1 + 2 files changed, 21 insertions(+) create mode 100755 html/do-add-player.pl diff --git a/html/do-add-player.pl b/html/do-add-player.pl new file mode 100755 index 0000000..7817b14 --- /dev/null +++ b/html/do-add-player.pl @@ -0,0 +1,20 @@ +#! /usr/bin/perl + +use ccbs; +use strict; +use warnings; + +my $dbh = ccbs::db_connect(); +my $cgi = new CGI; + +my $tournament = $cgi->param('tournament'); +my $nick = $cgi->param('nick'); + +$dbh->do('INSERT INTO players (nick) VALUES (?)', undef, $nick); +my $ref = $dbh->selectrow_hashref('SELECT player FROM players WHERE nick=?', + undef, $nick); + +ccbs::print_see_other('registration.pl?id=' . $tournament . '&player=' . + $ref->{'player'}); + +$dbh->disconnect; diff --git a/html/templates/registration.tmpl b/html/templates/registration.tmpl index 38d2d65..73cdcdd 100644 --- a/html/templates/registration.tmpl +++ b/html/templates/registration.tmpl @@ -44,6 +44,7 @@ + -- 2.39.2