From 35f6e765d69f966c8b4abc84f25bb0bfa3df9853 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 14 Feb 2005 15:27:42 +0000 Subject: [PATCH] Added a backend (not working yet) for registering people. --- html/ccbs.pm | 7 +++++++ html/do-registration.pl | 19 +++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100755 html/do-registration.pl diff --git a/html/ccbs.pm b/html/ccbs.pm index 7087d5f..7d5f90d 100755 --- a/html/ccbs.pm +++ b/html/ccbs.pm @@ -10,6 +10,13 @@ our $ccbs_dbdebug = 0; sub print_header { print CGI::header(-type=>'text/html; charset=utf-8'); } +sub print_see_other { + my $location = shift; + + print CGI::header(-status=>'303 See other', + -location=>'http://ccbs.sesse.net/' . $location, + -type=>'text/html; charset=utf-8'); +} sub db_connect { $ccbs_dbdebug = defined(shift) ? 1 : 0; diff --git a/html/do-registration.pl b/html/do-registration.pl new file mode 100755 index 0000000..a81e48a --- /dev/null +++ b/html/do-registration.pl @@ -0,0 +1,19 @@ +#! /usr/bin/perl + +use ccbs; +use strict; +use warnings; + +my $dbh = ccbs::db_connect(); +my $cgi = new CGI; + +my $tournament = $cgi->param('tournament'); +my $player = $cgi->param('player'); +my $paid = $cgi->param('paid'); + +$dbh->do('INSERT INTO tournamentparticipation (tournament, player, paid) VALUES (?,?,?)', + undef, $tournament, $player, $paid); + +ccbs::print_see_other('registration.pl?id=$tournament'); + +$dbh->disconnect; -- 2.39.2