/[suikacvs]/perl/kanzan/kanzan.cgi
Suika

Diff of /perl/kanzan/kanzan.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by wakaba, Wed Sep 4 09:02:38 2002 UTC revision 1.5 by wakaba, Wed Nov 5 12:52:46 2003 UTC
# Line 1  Line 1 
1  #!/usr/local/bin/perl  #!/usr/bin/perl
2    
3  use strict;  use strict;
4  require Suika::CGI;  
5    for (split /[&;]/, $main::ENV{QUERY_STRING}) {
6      
7    }
8    
9  my %ex_point1 = ();  my %ex_point1 = ();
10  (  (
# Line 89  sub kanzan (%%%%) { Line 92  sub kanzan (%%%%) {
92    ($percent, $object_percent, \%kanzaned1, \%kanzaned2);    ($percent, $object_percent, \%kanzaned1, \%kanzaned2);
93  }  }
94    
95    %Suika::CGI::param = %{__get_parameter ()};
96  my (%mypoint1, %mypoint2, %haiten1, %haiten2);  my (%mypoint1, %mypoint2, %haiten1, %haiten2);
97  if ($Suika::CGI::param{newform} ne 'no') {  if ($Suika::CGI::param{newform} ne 'no') {
98    %mypoint1 = %ex_point1;    %mypoint1 = %ex_point1;
# Line 142  sub output_html (%%%%%) { Line 146  sub output_html (%%%%%) {
146  <head>  <head>
147  <title>配点換算</title>  <title>配点換算</title>
148  <link rev="made" href="mailto:w\@suika.fam.cx">  <link rev="made" href="mailto:w\@suika.fam.cx">
149  <link rel="contents" href="http://tomikou.net/">  <link rel="contents" href="http://tomikou.net/tokshuu/kanzan.html" title="換算点算出システム
150    ">
151  <link rel="contents" href="/chuubu/">  <link rel="contents" href="/chuubu/">
152  <style type="text/css">  <link rel="stylesheet" href="/s/default/xhtml1" media="all">
153    <style type="text/css" media="all">
154  input   {width: 3em}  input   {width: 3em}
155  </style>  </style>
156  </head>  </head>
157  <body>  <body>
158  <h1>配点換算</h1>  <h1>配点換算</h1>
159  <form action="kanzan" method="post" accept-charset="iso-2022-jp, iso-2022-jp-3">  <form action="kanzan" method="post" accept-charset="iso-2022-jp">
160  <table>  <table>
161  <thead>  <thead>
162  <tr>  <tr>
# Line 263  input  {width: 3em} Line 269  input  {width: 3em}
269  </form>  </form>
270    
271  <div class="navigation">  <div class="navigation">
272  [<a href="/gate/cvs/perl/kanzan/" xml:lang="en">source</a>]  [<a href="/gate/cvs/perl/kanzan/" lang="en">source</a>]
273  </div>  </div>
274  </body>  </body>
275  </html>  </html>
276  EOH  EOH
277  }  }
278    
279    sub __get_parameter () {
280      my @src;
281      
282      ## Query-string of Request-URI
283      my $qs = $main::ENV{QUERY_STRING};
284      push @src, $qs if (index ($qs, '=') > -1);
285      
286      ## Entity-body
287      if ($main::ENV{REQUEST_METHOD} eq 'POST') {
288        my $mt = $main::ENV{CONTENT_TYPE};
289        if ($mt =~ m<^application/(?:x-www|sgml)-form-urlencoded\b>) {
290          my $body;
291          read STDIN, $body, $main::ENV{CONTENT_LENGTH};
292          push @src, $body;
293        }
294      }
295      
296      my %temp_params;
297      for my $src (@src) {
298        for (split /[;&]/, $src) {
299          my ($name, $val) = split '=', $_, 2;
300          for ($name, $val) {
301            tr/+/ /;
302            s/%([0-9A-Fa-f][0-9A-Fa-f])/pack 'C', hex $1/ge;
303          }
304          $temp_params{$name} = $val;
305        }
306      }
307      \%temp_params;
308    }
309    
310    
311  =head1 LICENSE  =head1 LICENSE
312    
313  Copyright 2001-2002 wakaba E<lt>w@suika.fam.cxE<gt>.  Copyright 2001-2003 Wakaba E<lt>w@suika.fam.cxE<gt>.
314    
315  This program is free software; you can redistribute it and/or modify  This program is free software; you can redistribute it and/or modify
316  it under the terms of the GNU General Public License as published by  it under the terms of the GNU General Public License as published by
# Line 292  Boston, MA 02111-1307, USA. Line 330  Boston, MA 02111-1307, USA.
330  =cut  =cut
331    
332  1;      # $Date$  1;      # $Date$
333  ### kanzan.cgi ends here  

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24