瀏覽代碼

[kitagata_support:11643] HP更新依頼(雇用調整助成金)

KuniakiTakenaka 3 年之前
父節點
當前提交
ac2503b7c2

+ 10497
- 0
cgi-bin/mail/jacode.pl
文件差異過大導致無法顯示
查看文件


+ 731
- 0
cgi-bin/mail/jcode.pl 查看文件

@@ -0,0 +1,731 @@
1
+package jcode;
2
+;######################################################################
3
+;#
4
+;# jcode.pl: Perl library for Japanese character code conversion
5
+;#
6
+;# Copyright (c) 1995-1998 Kazumasa Utashiro <utashiro@iij.ad.jp>
7
+;# Internet Initiative Japan Inc.
8
+;# 3-13 Kanda Nishiki-cho, Chiyoda-ku, Tokyo 101-0054, Japan
9
+;#
10
+;# Copyright (c) 1992,1993,1994 Kazumasa Utashiro
11
+;# Software Research Associates, Inc.
12
+;#
13
+;# Original version was developed under the name of srekcah@sra.co.jp
14
+;# February 1992 and it was called kconv.pl at the beginning.  This
15
+;# address was a pen name for group of individuals and it is no longer
16
+;# valid.
17
+;#
18
+;# Use and redistribution for ANY PURPOSE, without significant
19
+;# modification, is granted as long as all copyright notices are
20
+;# retained.  THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
21
+;# ANY EXPRESS OR IMPLIED WARRANTIES ARE DISCLAIMED.
22
+;#
23
+;# The latest version is available here:
24
+;#
25
+;#	ftp://ftp.iij.ad.jp/pub/IIJ/dist/utashiro/perl/
26
+;#
27
+;; $rcsid = q$Id: jcode.pl,v 2.8 1998/09/23 17:22:55 utashiro Exp $;
28
+;#
29
+;######################################################################
30
+;#
31
+;# PERL4 INTERFACE:
32
+;#
33
+;#	&jcode'getcode(*line)
34
+;#		Return 'jis', 'sjis', 'euc' or undef according to
35
+;#		Japanese character code in $line.  Return 'binary' if
36
+;#		the data has non-character code.
37
+;#
38
+;#		When evaluated in array context, it returns a list
39
+;#		contains two items.  First value is the number of
40
+;#		characters which matched to the expected code, and
41
+;#		second value is the code name.  It is useful if and
42
+;#		only if the number is not 0 and the code is undef;
43
+;#		that case means it couldn't tell 'euc' or 'sjis'
44
+;#		because the evaluation score was exactly same.  This
45
+;#		interface is too tricky, though.
46
+;#
47
+;#		Code detection between euc and sjis is very difficult
48
+;#		or sometimes impossible or even lead to wrong result
49
+;#		when it includes JIS X0201 KANA characters.  So JIS
50
+;#		X0201 KANA is ignored for automatic code detection.
51
+;#
52
+;#	&jcode'convert(*line, $ocode [, $icode [, $option]])
53
+;#		Convert the contents of $line to the specified
54
+;#		Japanese code given in the second argument $ocode.
55
+;#		$ocode can be any of "jis", "sjis" or "euc", or use
56
+;#		"noconv" when you don't want the code conversion.
57
+;#		Input code is recognized automatically from the line
58
+;#		itself when $icode is not supplied (JIS X0201 KANA is
59
+;#		ignored in code detection.  See the above descripton
60
+;#		of &getcode).  $icode also can be specified, but
61
+;#		xxx2yyy routine is more efficient when both codes are
62
+;#		known.
63
+;#
64
+;#		It returns the code of input string in scalar context,
65
+;#		and a list of pointer of convert subroutine and the
66
+;#		input code in array context.
67
+;#
68
+;#		Japanese character code JIS X0201, X0208, X0212 and
69
+;#		ASCII code are supported.  X0212 characters can not be
70
+;#		represented in SJIS and they will be replased by
71
+;#		"geta" character when converted to SJIS.
72
+;#
73
+;#		See next paragraph for $option parameter.
74
+;#
75
+;#	&jcode'xxx2yyy(*line [, $option])
76
+;#		Convert the Japanese code from xxx to yyy.  String xxx
77
+;#		and yyy are any convination from "jis", "euc" or
78
+;#		"sjis".  They return *approximate* number of converted
79
+;#		bytes.  So return value 0 means the line was not
80
+;#		converted at all.
81
+;#
82
+;#		Optional parameter $option is used to specify optional
83
+;#		conversion method.  String "z" is for JIS X0201 KANA
84
+;#		to X0208 KANA, and "h" is for reverse.
85
+;#
86
+;#	$jcode'convf{'xxx', 'yyy'}
87
+;#		The value of this associative array is pointer to the
88
+;#		subroutine jcode'xxx2yyy().
89
+;#
90
+;#	&jcode'to($ocode, $line [, $icode [, $option]])
91
+;#	&jcode'jis($line [, $icode [, $option]])
92
+;#	&jcode'euc($line [, $icode [, $option]])
93
+;#	&jcode'sjis($line [, $icode [, $option]])
94
+;#		These functions are prepared for easy use of
95
+;#		call/return-by-value interface.  You can use these
96
+;#		funcitons in s///e operation or any other place for
97
+;#		convenience.
98
+;#
99
+;#	&jcode'jis_inout($in, $out)
100
+;#		Set or inquire JIS start and end sequences.  Default
101
+;#		is "ESC-$-B" and "ESC-(-B".  If you supplied only one
102
+;#		character, "ESC-$" or "ESC-(" is prepended for each
103
+;#		character respectively.  Acutually "ESC-(-B" is not a
104
+;#		sequence to end JIS code but a sequence to start ASCII
105
+;#		code set.  So `in' and `out' are somewhat misleading.
106
+;#
107
+;#	&jcode'get_inout($string)
108
+;#		Get JIS start and end sequences from $string.
109
+;#
110
+;#	&jcode'cache()
111
+;#	&jcode'nocache()
112
+;#	&jcode'flush()
113
+;#		Usually, converted character is cached in memory to
114
+;#		avoid same calculations have to be done many times.
115
+;#		To disable this caching, call &jcode'nocache().  It
116
+;#		can be revived by &jcode'cache() and cache is flushed
117
+;#		by calling &jcode'flush().  &cache() and &nocache()
118
+;#		functions return previous caching state.
119
+;#
120
+;#	---------------------------------------------------------------
121
+;#
122
+;#	&jcode'h2z_xxx(*line)
123
+;#		JIS X0201 KANA (so-called Hankaku-KANA) to X0208 KANA
124
+;#		(Zenkaku-KANA) code conversion routine.  String xxx is
125
+;#		any of "jis", "sjis" and "euc".  From the difficulty
126
+;#		of recognizing code set from 1-byte KATAKANA string,
127
+;#		automatic code recognition is not supported.
128
+;#
129
+;#	&jcode'z2h_xxx(*line)
130
+;#		X0208 to X0201 KANA code conversion routine.  String
131
+;#		xxx is any of "jis", "sjis" and "euc".
132
+;#
133
+;#	$jcode'z2hf{'xxx'}
134
+;#	$jcode'h2zf{'xxx'}
135
+;#		These are pointer to the corresponding function just
136
+;#		as $jcode'convf.
137
+;#
138
+;#	---------------------------------------------------------------
139
+;#
140
+;#	&jcode'tr(*line, $from, $to [, $option])
141
+;#		&jcode'tr emulates tr operator for 2 byte code.  Only 'd'
142
+;#		is interpreted as option.
143
+;#
144
+;#		Range operator like `A-Z' for 2 byte code is partially
145
+;#		supported.  Code must be JIS or EUC, and first byte
146
+;#		should be same on first and last character.
147
+;#
148
+;#		CAUTION: Handling range operator is a kind of trick
149
+;#		and it is not perfect.  So if you need to transfer `-' 
150
+;#		character, please be sure to put it at the beginning
151
+;#		or the end of $from and $to strings.
152
+;#
153
+;#	&jcode'trans($line, $from, $to [, $option)
154
+;#		Same as &jcode'tr but accept string and return string
155
+;#		after translation.
156
+;#
157
+;#	---------------------------------------------------------------
158
+;#
159
+;#	&jcode'init()
160
+;#		Initialize the variables used in this package.  You
161
+;#		don't have to call this when using jocde.pl by `do' or
162
+;#		`require' interface.  Call it first if you embedded
163
+;#		the jcode.pl at the end of your script.
164
+;#
165
+;######################################################################
166
+;#
167
+;# PERL5 INTERFACE:
168
+;#
169
+;#	Current jcode.pl is written in Perl 4 but it is possible to
170
+;#	use from Perl 5 using `references'.  Fully perl5 capable version
171
+;#	is future issue.
172
+;#
173
+;#	jcode::getcode(\$line)
174
+;#	jcode::convert(\$line, $ocode [, $icode [, $option]])
175
+;#	jcode::xxx2yyy(\$line [, $option])
176
+;#	&{$jcode::convf{'xxx', 'yyy'}}(\$line)
177
+;#	jcode::to($ocode, $line [, $icode [, $option]])
178
+;#	jcode::jis($line [, $icode [, $option]])
179
+;#	jcode::euc($line [, $icode [, $option]])
180
+;#	jcode::sjis($line [, $icode [, $option]])
181
+;#	jcode::jis_inout($in, $out)
182
+;#	jcode::get_inout($string)
183
+;#	jcode::cache()
184
+;#	jcode::nocache()
185
+;#	jcode::flush()
186
+;#	jcode::h2z_xxx(\$line)
187
+;#	jcode::z2h_xxx(\$line)
188
+;#	&{$jcode::z2hf{'xxx'}}(\$line)
189
+;#	&{$jcode::h2zf{'xxx'}}(\$line)
190
+;#	jcode::tr(\$line, $from, $to [, $option])
191
+;#	jcode::trans($line, $from, $to [, $option)
192
+;#	jcode::init()
193
+;#
194
+;######################################################################
195
+;#
196
+;# SAMPLES
197
+;#
198
+;# Convert any Kanji code to JIS and print each line with code name.
199
+;#
200
+;#	while (<>) {
201
+;#	    $code = &jcode'convert(*_, 'jis');
202
+;#	    print $code, "\t", $_;
203
+;#	}
204
+;#	
205
+;# Convert all lines to JIS according to the first recognized line.
206
+;#
207
+;#	while (<>) {
208
+;#	    print, next unless /[\033\200-\377]/;
209
+;#	    (*f, $icode) = &jcode'convert(*_, 'jis');
210
+;#	    print;
211
+;#	    defined(&f) || next;
212
+;#	    while (<>) { &f(*_); print; }
213
+;#	    last;
214
+;#	}
215
+;#
216
+;# The safest way of JIS conversion.
217
+;#
218
+;#	while (<>) {
219
+;#	    ($matched, $code) = &jcode'getcode(*_);
220
+;#	    print, next unless (@buf || $matched);
221
+;#	    push(@buf, $_);
222
+;#	    next unless $code;
223
+;#	    eval "&jcode'${code}2jis(*_), print while (\$_ = shift(\@buf));";
224
+;#	    eval "&jcode'${code}2jis(*_), print while (\$_ = <>);";
225
+;#	    last;
226
+;#	}
227
+;#		
228
+;######################################################################
229
+
230
+;#
231
+;# Call initialize function if it is not called yet.  This may sound
232
+;# strange but it makes easy to embed the jcode.pl at the end of
233
+;# script.  Call &jcode'init at the beginning of the script in that
234
+;# case.
235
+;#
236
+&init unless defined $version;
237
+
238
+;#
239
+;# Initialize variables.
240
+;#
241
+sub init {
242
+    $version = $rcsid =~ /,v ([\d.]+)/ ? $1 : 'unkown';
243
+
244
+    $re_bin  = '[\000-\006\177\377]';
245
+
246
+    $re_jis0208_1978 = '\e\$\@';
247
+    $re_jis0208_1983 = '\e\$B';
248
+    $re_jis0208_1990 = '\e&\@\e\$B';
249
+    $re_jis0208 = "$re_jis0208_1978|$re_jis0208_1983|$re_jis0208_1990";
250
+    $re_jis0212 = '\e\$\(D';
251
+    $re_jp      = "$re_jis0208|$re_jis0212";
252
+    $re_asc     = '\e\([BJ]';
253
+    $re_kana    = '\e\(I';
254
+    $esc_0208 = "\e\$B";
255
+    $esc_0212 = "\e\$(D";
256
+    $esc_asc  = "\e(B";
257
+    $esc_kana = "\e(I";
258
+
259
+    $re_sjis_c    = '[\201-\237\340-\374][\100-\176\200-\374]';
260
+    $re_sjis_kana = '[\241-\337]';
261
+
262
+    $re_euc_c    = '[\241-\376][\241-\376]';
263
+    $re_euc_kana = '\216[\241-\337]';
264
+    $re_euc_0212 = '\217[\241-\376][\241-\376]';
265
+
266
+    # Use `geta' for undefined character code
267
+    $undef_sjis = "\x81\xac";
268
+
269
+    $cache = 1;
270
+
271
+    # X0201 -> X0208 KANA conversion table.  Looks weird?  Not that
272
+    # much.  This is simply JIS text without escape sequences.
273
+    ($h2z_high = $h2z = <<'__TABLE_END__') =~ tr/\041-\176/\241-\376/;
274
+!	!#	$	!"	%	!&	"	!V	#	!W
275
+^	!+	_	!,	0	!<
276
+'	%!	(	%#	)	%%	*	%'	+	%)
277
+,	%c	-	%e	.	%g	/	%C
278
+1	%"	2	%$	3	%&	4	%(	5	%*
279
+6	%+	7	%-	8	%/	9	%1	:	%3
280
+6^	%,	7^	%.	8^	%0	9^	%2	:^	%4
281
+;	%5	<	%7	=	%9	>	%;	?	%=
282
+;^	%6	<^	%8	=^	%:	>^	%<	?^	%>
283
+@	%?	A	%A	B	%D	C	%F	D	%H
284
+@^	%@	A^	%B	B^	%E	C^	%G	D^	%I
285
+E	%J	F	%K	G	%L	H	%M	I	%N
286
+J	%O	K	%R	L	%U	M	%X	N	%[
287
+J^	%P	K^	%S	L^	%V	M^	%Y	N^	%\
288
+J_	%Q	K_	%T	L_	%W	M_	%Z	N_	%]
289
+O	%^	P	%_	Q	%`	R	%a	S	%b
290
+T	%d			U	%f			V	%h
291
+W	%i	X	%j	Y	%k	Z	%l	[	%m
292
+\	%o	]	%s	&	%r	3^	%t
293
+__TABLE_END__
294
+    %h2z = split(/\s+/, $h2z . $h2z_high);
295
+    %z2h = reverse %h2z;
296
+
297
+    $convf{'jis'  , 'jis' } = *jis2jis;
298
+    $convf{'jis'  , 'sjis'} = *jis2sjis;
299
+    $convf{'jis'  , 'euc' } = *jis2euc;
300
+    $convf{'euc'  , 'jis' } = *euc2jis;
301
+    $convf{'euc'  , 'sjis'} = *euc2sjis;
302
+    $convf{'euc'  , 'euc' } = *euc2euc;
303
+    $convf{'sjis' , 'jis' } = *sjis2jis;
304
+    $convf{'sjis' , 'sjis'} = *sjis2sjis;
305
+    $convf{'sjis' , 'euc' } = *sjis2euc;
306
+    $h2zf{'jis' } = *h2z_jis;
307
+    $z2hf{'jis' } = *z2h_jis;
308
+    $h2zf{'euc' } = *h2z_euc;
309
+    $z2hf{'euc' } = *z2h_euc;
310
+    $h2zf{'sjis'} = *h2z_sjis;
311
+    $z2hf{'sjis'} = *z2h_sjis;
312
+}
313
+
314
+;#
315
+;# Set escape sequences which should be put before and after Japanese
316
+;# (JIS X0208) string.
317
+;#
318
+sub jis_inout {
319
+    $esc_0208 = shift || $esc_0208;
320
+    $esc_0208 = "\e\$$esc_0208" if length($esc_0208) == 1;
321
+    $esc_asc = shift || $esc_asc;
322
+    $esc_asc = "\e\($esc_asc" if length($esc_asc) == 1;
323
+    ($esc_0208, $esc_asc);
324
+}
325
+
326
+;#
327
+;# Get JIS in and out sequences from the string.
328
+;#
329
+sub get_inout {
330
+    local($esc_0208, $esc_asc);
331
+    $_[$[] =~ /$re_jis0208/o && ($esc_0208 = $&);
332
+    $_[$[] =~ /$re_asc/o && ($esc_asc = $&);
333
+    ($esc_0208, $esc_asc);
334
+}
335
+
336
+;#
337
+;# Recognize character code.
338
+;#
339
+sub getcode {
340
+    local(*_) = @_;
341
+    local($matched, $code);
342
+
343
+    if (!/[\e\200-\377]/) {	# not Japanese
344
+	$matched = 0;
345
+	$code = undef;
346
+    }				# 'jis'
347
+    elsif (/$re_jp|$re_asc|$re_kana/o) {
348
+	$matched = 1;
349
+	$code = 'jis';
350
+    }
351
+    elsif (/$re_bin/o) {	# 'binary'
352
+	$matched = 0;
353
+	$code = 'binary';
354
+    }
355
+    else {			# should be 'euc' or 'sjis'
356
+	local($sjis, $euc);
357
+
358
+	$sjis += length($&) while /($re_sjis_c)+/go;
359
+	$euc  += length($&) while /($re_euc_c|$re_euc_kana|$re_euc_0212)+/go;
360
+
361
+	$matched = &max($sjis, $euc);
362
+	$code = ('euc', undef, 'sjis')[($sjis<=>$euc) + $[ + 1];
363
+    }
364
+    wantarray ? ($matched, $code) : $code;
365
+}
366
+sub max { $_[ $[ + ($_[$[] < $_[$[+1]) ]; }
367
+
368
+;#
369
+;# Convert any code to specified code.
370
+;#
371
+sub convert {
372
+    local(*_, $ocode, $icode, $opt) = @_;
373
+    return (undef, undef) unless $icode = $icode || &getcode(*_);
374
+    return (undef, $icode) if $icode eq 'binary';
375
+    $ocode = 'jis' unless $ocode;
376
+    $ocode = $icode if $ocode eq 'noconv';
377
+    local(*f) = $convf{$icode, $ocode};
378
+    &f(*_, $opt);
379
+    wantarray ? (*f, $icode) : $icode;
380
+}
381
+
382
+;#
383
+;# Easy return-by-value interfaces.
384
+;#
385
+sub jis  { &to('jis',  @_); }
386
+sub euc  { &to('euc',  @_); }
387
+sub sjis { &to('sjis', @_); }
388
+sub to {
389
+    local($ocode, $_, $icode, $opt) = @_;
390
+    &convert(*_, $ocode, $icode, $opt);
391
+    $_;
392
+}
393
+sub what {
394
+    local($_) = @_;
395
+    &getcode(*_);
396
+}
397
+sub trans {
398
+    local($_) = shift;
399
+    &tr(*_, @_);
400
+    $_;
401
+}
402
+
403
+;#
404
+;# SJIS to JIS
405
+;#
406
+sub sjis2jis {
407
+    local(*_, $opt, $n) = @_;
408
+    &sjis2sjis(*_, $opt) if $opt;
409
+    s/($re_sjis_kana)+|($re_sjis_c)+/&_sjis2jis($&, $')/geo;
410
+    $n;
411
+}
412
+sub _sjis2jis {
413
+    local($_) = shift;
414
+    local($post) = $_[$[] =~ /^($re_sjis_kana|$re_sjis_c)/o ? "" : $esc_asc;
415
+    if (/^$re_sjis_kana/o) {
416
+	$n += tr/\241-\337/\041-\137/;
417
+	$esc_kana . $_ . $post;
418
+    } else {
419
+	$n += s/$re_sjis_c/$s2e{$&}||&s2e($&)/geo;
420
+	tr/\241-\376/\041-\176/;
421
+	$esc_0208 . $_ . $post;
422
+    }
423
+}
424
+
425
+;#
426
+;# EUC to JIS
427
+;#
428
+sub euc2jis {
429
+    local(*_, $opt, $n) = @_;
430
+    &euc2euc(*_, $opt) if $opt;
431
+    s/($re_euc_kana)+|($re_euc_c)+|($re_euc_0212)+/&_euc2jis($&, $')/geo;
432
+    $n;
433
+}
434
+sub _euc2jis {
435
+    local($_) = shift;
436
+    local($pre, $post);
437
+
438
+    $pre = tr/\216//d ? $esc_kana : tr/\217//d ? $esc_0212 : $esc_0208;
439
+    if ($_[$[] =~ /^($re_euc_kana|$re_euc_c|$re_euc_0212)/o) {
440
+	$post = "";
441
+    } else {
442
+	$post = $esc_asc;
443
+    }
444
+    $n += tr/\241-\376/\041-\176/;
445
+    $pre . $_ . $post;
446
+}
447
+
448
+;#
449
+;# JIS to EUC
450
+;#
451
+sub jis2euc {
452
+    local(*_, $opt, $n) = @_;
453
+    s/($re_jp|$re_asc|$re_kana)([^\e]*)/&_jis2euc($1,$2)/geo;
454
+    &euc2euc(*_, $opt) if $opt;
455
+    $n;
456
+}
457
+sub _jis2euc {
458
+    local($esc, $_) = @_;
459
+    if ($esc !~ /$re_asc/o) {
460
+	$n += tr/\041-\176/\241-\376/;
461
+	if ($esc =~ /$re_kana/o) {
462
+	    s/[\241-\337]/\216$&/g;
463
+	}
464
+	elsif ($esc =~ /$re_jis0212/o) {
465
+	    s/[\241-\376][\241-\376]/\217$&/g;
466
+	}
467
+    }
468
+    $_;
469
+}
470
+
471
+;#
472
+;# JIS to SJIS
473
+;#
474
+sub jis2sjis {
475
+    local(*_, $opt, $n) = @_;
476
+    &jis2jis(*_, $opt) if $opt;
477
+    s/($re_jp|$re_asc|$re_kana)([^\e]*)/&_jis2sjis($1,$2)/geo;
478
+    $n;
479
+}
480
+sub _jis2sjis {
481
+    local($esc, $_) = @_;
482
+    if ($esc =~ /$re_jis0212/o) {
483
+	s/../$undef_sjis/g;
484
+	$n = length;
485
+    }
486
+    elsif ($esc !~ /$re_asc/o) {
487
+	$n += tr/\041-\176/\241-\376/;
488
+	s/$re_euc_c/$e2s{$&}||&e2s($&)/geo if $esc =~ /$re_jp/o;
489
+    }
490
+    $_;
491
+}
492
+
493
+;#
494
+;# SJIS to EUC
495
+;#
496
+sub sjis2euc {
497
+    local(*_, $opt,$n) = @_;
498
+    $n = s/$re_sjis_kana|$re_sjis_c/$s2e{$&}||&s2e($&)/geo;
499
+    &euc2euc(*_, $opt) if $opt;
500
+    $n;
501
+}
502
+sub s2e {
503
+    local($c1, $c2, $code);
504
+    ($c1, $c2) = unpack('CC', $code = shift);
505
+
506
+    if (0xa1 <= $c1 && $c1 <= 0xdf) {
507
+	$c2 = $c1;
508
+	$c1 = 0x8e;
509
+    } elsif (0x9f <= $c2) {
510
+	$c1 = $c1 * 2 - ($c1 >= 0xe0 ? 0xe0 : 0x60);
511
+	$c2 += 2;
512
+    } else {
513
+	$c1 = $c1 * 2 - ($c1 >= 0xe0 ? 0xe1 : 0x61);
514
+	$c2 += 0x60 + ($c2 < 0x7f);
515
+    }
516
+    if ($cache) {
517
+	$s2e{$code} = pack('CC', $c1, $c2);
518
+    } else {
519
+	pack('CC', $c1, $c2);
520
+    }
521
+}
522
+
523
+;#
524
+;# EUC to SJIS
525
+;#
526
+sub euc2sjis {
527
+    local(*_, $opt,$n) = @_;
528
+    &euc2euc(*_, $opt) if $opt;
529
+    $n = s/$re_euc_c|$re_euc_kana|$re_euc_0212/$e2s{$&}||&e2s($&)/geo;
530
+}
531
+sub e2s {
532
+    local($c1, $c2, $code);
533
+    ($c1, $c2) = unpack('CC', $code = shift);
534
+
535
+    if ($c1 == 0x8e) {		# SS2
536
+	return substr($code, 1, 1);
537
+    } elsif ($c1 == 0x8f) {	# SS3
538
+	return $undef_sjis;
539
+    } elsif ($c1 % 2) {
540
+	$c1 = ($c1>>1) + ($c1 < 0xdf ? 0x31 : 0x71);
541
+	$c2 -= 0x60 + ($c2 < 0xe0);
542
+    } else {
543
+	$c1 = ($c1>>1) + ($c1 < 0xdf ? 0x30 : 0x70);
544
+	$c2 -= 2;
545
+    }
546
+    if ($cache) {
547
+	$e2s{$code} = pack('CC', $c1, $c2);
548
+    } else {
549
+	pack('CC', $c1, $c2);
550
+    }
551
+}
552
+
553
+;#
554
+;# JIS to JIS, SJIS to SJIS, EUC to EUC
555
+;#
556
+sub jis2jis {
557
+    local(*_, $opt) = @_;
558
+    s/$re_jis0208/$esc_0208/go;
559
+    s/$re_asc/$esc_asc/go;
560
+    &h2z_jis(*_) if $opt =~ /z/;
561
+    &z2h_jis(*_) if $opt =~ /h/;
562
+}
563
+sub sjis2sjis {
564
+    local(*_, $opt) = @_;
565
+    &h2z_sjis(*_) if $opt =~ /z/;
566
+    &z2h_sjis(*_) if $opt =~ /h/;
567
+}
568
+sub euc2euc {
569
+    local(*_, $opt) = @_;
570
+    &h2z_euc(*_) if $opt =~ /z/;
571
+    &z2h_euc(*_) if $opt =~ /h/;
572
+}
573
+
574
+;#
575
+;# Cache control functions
576
+;#
577
+sub cache {
578
+    ($cache, $cache = 1)[$[];
579
+}
580
+sub nocache {
581
+    ($cache, $cache = 0)[$[];
582
+}
583
+sub flushcache {
584
+    undef %e2s;
585
+    undef %s2e;
586
+}
587
+
588
+;#
589
+;# X0201 -> X0208 KANA conversion routine
590
+;#
591
+sub h2z_jis {
592
+    local(*_, $n) = @_;
593
+    if (s/$re_kana([^\e]*)/$esc_0208 . &_h2z_jis($1)/geo) {
594
+	1 while s/(($re_jis0208)[^\e]*)($re_jis0208)/$1/o;
595
+    }
596
+    $n;
597
+}
598
+sub _h2z_jis {
599
+    local($_) = @_;
600
+    $n += s/[\41-\137]([\136\137])?/$h2z{$&}/g;
601
+    $_;
602
+}
603
+
604
+sub h2z_euc {
605
+    local(*_) = @_;
606
+    s/\216([\241-\337])(\216([\336\337]))?/$h2z{"$1$3"}/g;
607
+}
608
+
609
+sub h2z_sjis {
610
+    local(*_, $n) = @_;
611
+    s/(($re_sjis_c)+)|(([\241-\337])([\336\337])?)/
612
+	$1 || ($n++, $e2s{$h2z{$3}} || &e2s($h2z{$3}))/geo;
613
+    $n;
614
+}
615
+
616
+;#
617
+;# X0208 -> X0201 KANA conversion routine
618
+;#
619
+sub z2h_jis {
620
+    local(*_, $n) = @_;
621
+    s/($re_jis0208)([^\e]+)/&_z2h_jis($2)/geo;
622
+    $n;
623
+}
624
+sub _z2h_jis {
625
+    local($_) = @_;
626
+    s/(\%[!-~]|![\#\"&VW+,<])+|([^!%][!-~]|![^\#\"&VW+,<])+/&__z2h_jis($&)/ge;
627
+    $_;
628
+}
629
+sub __z2h_jis {
630
+    local($_) = @_;
631
+    return $esc_0208 . $_ unless /^%/ || /^![\#\"&VW+,<]/;
632
+    $n += length($_) / 2;
633
+    s/../$z2h{$&}/g;
634
+    $esc_kana . $_;
635
+}
636
+
637
+sub z2h_euc {
638
+    local(*_, $n) = @_;
639
+    &init_z2h_euc unless defined %z2h_euc;
640
+    s/$re_euc_c|$re_euc_kana/$z2h_euc{$&} ? ($n++, $z2h_euc{$&}) : $&/geo;
641
+    $n;
642
+}
643
+
644
+sub z2h_sjis {
645
+    local(*_, $n) = @_;
646
+    &init_z2h_sjis unless defined %z2h_sjis;
647
+    s/$re_sjis_c/$z2h_sjis{$&} ? ($n++, $z2h_sjis{$&}) : $&/geo;
648
+    $n;
649
+}
650
+
651
+;#
652
+;# Initializing JIS X0208 to X0201 KANA table for EUC and SJIS.  This
653
+;# can be done in &init but it's not worth doing.  Similarly,
654
+;# precalculated table is not worth to occupy the file space and
655
+;# reduce the readability.  The author personnaly discourages to use
656
+;# X0201 Kana character in the any situation.
657
+;#
658
+sub init_z2h_euc {
659
+    local($k, $_);
660
+    s/[\241-\337]/\216$&/g && ($z2h_euc{$k} = $_) while ($k, $_) = each %z2h;
661
+}
662
+sub init_z2h_sjis {
663
+    local($_, $v);
664
+    /[\200-\377]/ && ($z2h_sjis{&e2s($_)} = $v) while ($_, $v) = each %z2h;
665
+}
666
+
667
+;#
668
+;# TR function for 2-byte code
669
+;#
670
+sub tr {
671
+    # $prev_from, $prev_to, %table are persistent variables
672
+    local(*_, $from, $to, $opt) = @_;
673
+    local(@from, @to);
674
+    local($jis, $n) = (0, 0);
675
+    
676
+    $jis++, &jis2euc(*_) if /$re_jp|$re_asc|$re_kana/o;
677
+    $jis++ if $to =~ /$re_jp|$re_asc|$re_kana/o;
678
+
679
+    if ($from ne $prev_from || $to ne $prev_to) {
680
+	($prev_from, $prev_to) = ($from, $to);
681
+	undef %table;
682
+	&_maketable;
683
+    }
684
+
685
+    s/[\200-\377][\000-\377]|[\000-\377]/
686
+	defined($table{$&}) && ++$n ? $table{$&} : $&/ge;
687
+
688
+    &euc2jis(*_) if $jis;
689
+
690
+    $n;
691
+}
692
+
693
+sub _maketable {
694
+    local($ascii) = '(\\\\[\\-\\\\]|[\0-\133\135-\177])';
695
+
696
+    &jis2euc(*to) if $to =~ /$re_jp|$re_asc|$re_kana/o;
697
+    &jis2euc(*from) if $from =~ /$re_jp|$re_asc|$re_kana/o;
698
+
699
+    grep(s/([\200-\377])[\200-\377]-\1[\200-\377]/&_expnd2($&)/ge, $from, $to);
700
+    grep(s/$ascii-$ascii/&_expnd1($&)/geo, $from, $to);
701
+
702
+    @to   = $to   =~ /[\200-\377][\000-\377]|[\000-\377]/g;
703
+    @from = $from =~ /[\200-\377][\000-\377]|[\000-\377]/g;
704
+    push(@to, ($opt =~ /d/ ? '' : $to[$#to]) x (@from - @to)) if @to < @from;
705
+    @table{@from} = @to;
706
+}
707
+
708
+sub _expnd1 {
709
+    local($_) = @_;
710
+    s/\\(.)/$1/g;
711
+    local($c1, $c2) = unpack('CxC', $_);
712
+    if ($c1 <= $c2) {
713
+	for ($_ = ''; $c1 <= $c2; $c1++) {
714
+	    $_ .= pack('C', $c1);
715
+	}
716
+    }
717
+    $_;
718
+}
719
+
720
+sub _expnd2 {
721
+    local($_) = @_;
722
+    local($c1, $c2, $c3, $c4) = unpack('CCxCC', $_);
723
+    if ($c1 == $c3 && $c2 <= $c4) {
724
+	for ($_ = ''; $c2 <= $c4; $c2++) {
725
+	    $_ .= pack('CC', $c1, $c2);
726
+	}
727
+    }
728
+    $_;
729
+}
730
+
731
+1;

+ 1083
- 0
cgi-bin/mail/webform_.cgi
文件差異過大導致無法顯示
查看文件


+ 1083
- 0
cgi-bin/mail/webform_accounting.cgi
文件差異過大導致無法顯示
查看文件


+ 1083
- 0
cgi-bin/mail/webform_administration.cgi
文件差異過大導致無法顯示
查看文件


+ 1083
- 0
cgi-bin/mail/webform_disaster_prevention.cgi
文件差異過大導致無法顯示
查看文件


+ 1084
- 0
cgi-bin/mail/webform_education.cgi
文件差異過大導致無法顯示
查看文件


+ 684
- 0
cgi-bin/mail/webform_kirari.cgi 查看文件

@@ -0,0 +1,684 @@
1
+#!/usr/bin/perl
2
+
3
+;##########################################################################
4
+;#
5
+;# WebFORM v4.4 <フリーソフト>
6
+;#
7
+;#  (c)CGI-RESCUE
8
+;#  http://www.rescue.ne.jp/
9
+;#
10
+;# Hostory
11
+;# 06/Jun/1998 v3.0 セキュリティ強化
12
+;# 08/Aug/1998 v3.1 カーボンコピー処理改善
13
+;# 29/Oct/1998 v4.0 カーボンコピー処理はセキュリティの問題で廃止
14
+;# 16/Feb/2006 v4.1 スパムに対する脆弱性を修正
15
+;# 08/Jul/2006 v4.2 スパムに対する脆弱性を修正(v4.1の修正ミスを修正)
16
+;# 13/Nov/2006 v4.3 スパムメール防止機能を追加(スパムキー機能)
17
+;# 18/Jan/2007 v4.4 スパムに対する脆弱性を修正、およびSENDMAILの誤作動データの置換処理
18
+;#
19
+;##########################################################################
20
+
21
+#------ 初期設定 ----------------------------------------------------------
22
+
23
+#use Jcode;
24
+#use Encode;
25
+use Encode 'from_to';
26
+use Encode 'encode';
27
+use Encode 'decode';
28
+use MIME::Base64;
29
+
30
+#■日本語コード変換ライブラリ
31
+require './jacode.pl';
32
+
33
+#■SENDMAILの設定
34
+$sendmail = '/usr/lib/sendmail';
35
+
36
+#■受信先メールアドレス
37
+#$mailto = 'kuni.takenaka@gmail.com';
38
+$mailto = '';
39
+
40
+#■名称
41
+$title = 'メール送信';
42
+
43
+#■画面のボディ設定
44
+$body = '<body id="back">';
45
+
46
+#■記入者メールアドレス( name="email"の時 )未入力でも送信する  1:する 0:しない
47
+#  メールアドレスはあくまでも記入者の申告であり、正しいかどうかは分かりません。
48
+$mailcheck = 0;
49
+
50
+#■タイトル欄に入力がない場合のデフォルト値
51
+#$subject = '- NO SUBJECT -';
52
+$subject = "お問い合わせ";
53
+
54
+#■スパムキー機能を使う場合のキーワード設定
55
+#
56
+#  画面に表示した単語、文章、文字列を入力させたり、それを画像にしたものを入力させる(目の不自由な方には対応できないことに留意)、
57
+#  または質問の答えを書かせるなどして、このCGIの送信機能を悪用して自動で送信してくるスパムを、
58
+#  自動(ロボット)では処理できない段取りを挿入することにより防止する機能です。
59
+#
60
+#  スパムキー <input type="text" name="spam_key">
61
+#
62
+#  のように、「name=」を「spam_key」にして入力した内容は、CGI内に設定したキーワードと
63
+# 「一致」(半角・全角・大文字・小文字などは区別される)しなければ送信しないという機能です。
64
+#  これを設定しても、CGI内にキーワードを設定しない場合は設定エラーになります。キーワードを設定しても、フォームに設定しない場合は無視されます。
65
+#  キーワードは '' の間に設定してください。例:'日本' 例:'123'
66
+
67
+$spam_base_key = '';
68
+
69
+#--------------------------------------------------------------------------
70
+
71
+### 時刻取得
72
+($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
73
+@mon_array = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
74
+@wday_array = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
75
+$date_now = sprintf("%s, %02d %s %04d %02d:%02d:%02d +0900 (JST)",$wday_array[$wday],$mday,$mon_array[$mon],$year +1900,$hour,$min,$sec); # JSTは日本標準時という意味です
76
+
77
+### データ入力
78
+if ($ENV{'REQUEST_METHOD'} ne "POST") { &error('エラー','標準入力 METHOD=POST でご利用ください.'); }
79
+read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
80
+if ($buffer eq '') { &error('エラー','このプログラムは直接起動できません.','使い方を確認してください.'); }
81
+$ref = &encTag($ENV{'HTTP_REFERER'});
82
+$buffer2 = $ENV{'QUERY_STRING'};
83
+if ($buffer2 ne '') { &error('エラー','標準入力 METHOD=POST でご利用ください.','または、クエリーにデータが検出されました.'); }
84
+
85
+
86
+### デコード
87
+@pairs = split(/&/,$buffer);
88
+foreach $pair (@pairs) {
89
+
90
+	($name,$value) = split(/=/,$pair);
91
+	$value =~ tr/+/ /;
92
+	$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
93
+	$name =~ tr/+/ /;
94
+	$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
95
+
96
+	#&jcode'convert(*name,'jis'); &jcode'convert(*value,'jis');
97
+	#jcode::convert(*name,'sjis'); jcode::convert(*value,'sjis');
98
+	#jcode::convert(*name,'jis'); jcode::convert(*value,'jis');
99
+
100
+	#from_to($name, 'UTF-8', 'Shift_JIS'); from_to($value, 'UTF-8', 'Shift_JIS');
101
+	$env = jcode::getcode(*name);
102
+	if ($name eq "subject") {
103
+		$env = jcode::getcode(*value);
104
+	}
105
+	if ( $env eq "sjis" ) {
106
+		#from_to($name, 'Shift_JIS', 'UTF-8'); from_to($value, 'Shift_JIS', 'UTF-8');
107
+		#from_to($name, 'Shift_JIS', 'Shift_JIS'); from_to($value, 'Shift_JIS', 'Shift_JIS');
108
+		$name = decode('Shift_JIS', $name); $value = decode('Shift_JIS', $value);
109
+	} else { 
110
+		#from_to($name, 'UTF-8', 'Shift_JIS'); from_to($value, 'UTF-8', 'Shift_JIS');
111
+		$name = decode('UTF-8', $name); $value = decode('UTF-8', $value);
112
+	}
113
+	$name = encode('Shift_JIS', $name); $value = encode('Shift_JIS', $value);
114
+
115
+	#$value =~ s/http/"><s>te&st<\/s>/;#debug用
116
+
117
+	if ($value =~ /\r\n/) { $value =~ s/\r//g; } # 改行コードをUNIX(\n)に統一
118
+	elsif ($value =~ /\r/) { $value =~ s/\r/\n/g; }
119
+
120
+	if ($name eq "location") { $lct = &encTag($value); }
121
+	elsif ($name eq "c_copy" && $value eq "on") { $cc = "on"; }
122
+	elsif ($name eq "no_check" && $value eq "on") { $nocheck = "on"; }
123
+	elsif ($name eq "space_check" && $value eq "on") { $spcheck = "on"; }
124
+	elsif ($name eq "no_check") { ; }
125
+	elsif ($name eq "ref_url") { $ref_url = &encTag($value); }
126
+	elsif ($name eq "ref_name") { $ref_name = &encTag($value); }
127
+	elsif ($name eq "spam_key") { $spam_key = $value; $spam = 1; }
128
+	elsif ($name eq "subject" && $value ne "") { $subject = $value; }
129
+	elsif ($name eq "subject") { ; }
130
+	elsif ($name eq "ref_page") { $ref = &encTag($value); }
131
+	elsif ($name eq "password") {
132
+
133
+		$password = $value;
134
+		push(@DATA_N,$name);
135
+		push(@DATA_V,$value);
136
+	}
137
+	else {
138
+		if ($name =~ /^email/i || $name =~ /^e\-mail/i) {
139
+
140
+			$value =~ s/ / /g;
141
+			if ($value =~ / / || $value =~ /;/) { $value = ""; }
142
+			if (!($value =~ /(.*)\@(.*)\.(.*)/)) { $value = ""; }
143
+
144
+			$email = $value;
145
+		}
146
+
147
+		push(@DATA_N,$name);
148
+		push(@DATA_V,$value);
149
+
150
+		$name = &encTag($name);
151
+		$value = &encTag($value);
152
+		push(@DATA_NS,$name);
153
+		push(@DATA_VS,$value);
154
+	}
155
+}
156
+
157
+### 入力チェック
158
+$ref =~ s/\n|\r//g; # 汚染チェック
159
+$lct =~ s/\n|\r//g; # 汚染チェック
160
+if (!$mailcheck && $email eq '') { &error('エラー','Eメールを入力してください.'); }
161
+if ($mailcheck && $email eq '') { $email = 'anonymous@on.the.net'; } # メール未記入でも送信する場合の仮メールアドレス
162
+if ($spcheck eq "on") {	foreach (@DATA_V) { if ($_ eq "") { &error('送信できません','受信者の意向により、全ての項目を埋めないと送信できません.'); } }}
163
+if ($mailto eq '' || !($mailto =~ /(.*)\@(.*)\.(.*)/)) { &error('設定ミス','受信先メールアドレスが設定されていません.'); }
164
+if ($spam_base_key eq '' && $spam) { &error('設定ミス','スパムキー用のキーワードが設定されていません.'); }
165
+if ($spam_base_key ne '' && $spam_base_key ne $spam_key) { &error('送信できません','画面に書かれていることに従ってキーワードを入力してください.'); }
166
+if ($nocheck eq "on") { &sendmail; } # 確認画面を出さずに送信へ
167
+
168
+### 内容確認画面出力
169
+print "Content-type: text/html\n\n";
170
+print <<"EOF";
171
+<!doctype html>
172
+<html>
173
+<head>
174
+<meta charset="Shift_JIS">
175
+<title>$title</title>
176
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/base.css">
177
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_header.css">
178
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/footer.css">
179
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_section.css">
180
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/third_template.css" >
181
+<script src="http://www.town.kitagata.gifu.jp/kirari/js/include.js"></script>
182
+<meta name="google-translate-customization" content="45643f5d79d6e245-283971e7754d7b90-g905c6e6b6867bf2f-2f"></meta>
183
+</head>
184
+$body
185
+<div id="main" class="gothic">
186
+<!--セクション 操作-->
187
+<script type="text/javascript">
188
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/operation.html");
189
+</script>
190
+
191
+<!--ヘッダーデータ-->
192
+<script type="text/javascript">
193
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header.html");
194
+</script>
195
+
196
+<script type="text/javascript">
197
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header_public.html");
198
+</script>
199
+
200
+<!--セクション ブロック-->
201
+<div id="third_body">
202
+<!--セクション template-->
203
+<section id="template" >
204
+<!-- パンくずリスト -->
205
+<article id="breadcrumb" >
206
+<div id="breadcrumb_title">
207
+<div id="breadcrumb_title_block">
208
+<span id="breadcrumb_title"><a href="../../index.html">トップ</a>><a href="http://www.town.kitagata.gifu.jp/kirari/second/learning_consultation_service_life.html">生涯学習相談窓口</a>>お問い合わせ</span>
209
+</div>
210
+</div>
211
+</article>
212
+<!-- パンくずリスト ここまで -->
213
+<article id="template" >
214
+<div id="template_title" class="gothic">
215
+<div id="template_title_block">
216
+<span id="template_title">お問い合わせ</span>
217
+</div>
218
+</div>
219
+<!-- 大タイトルに本文データが無い場合はこのブロックを消す -->
220
+<span id="template_article_block">
221
+<h1>内容確認</h1>
222
+<form method="POST" action="webform_kirari.cgi">
223
+<blockquote>
224
+<table border=0 cellpadding=3 cellspacing=3>
225
+<tr><td bgcolor="#ffcccc"><b><font size=+1>項目</font></b></td><td bgcolor="#ffcccc"><b><font size=+1>内容</font></b></td></tr>
226
+EOF
227
+
228
+$count = @DATA_NS;
229
+
230
+foreach (0..$count-1) {
231
+
232
+	print "<input type=hidden name=\"$DATA_NS[($_)]\" value=\"$DATA_VS[($_)]\">\n";
233
+	print "<tr><td bgcolor=\"#ffeedd\">$DATA_NS[($_)] <br></td>";
234
+
235
+	if ($DATA_VS[($_)] =~ /\n/) { print "<td bgcolor=\"#ffffff\"><pre>$DATA_VS[($_)]</pre></td></tr>\n"; }
236
+	else { print "<td bgcolor=\"#ffffff\">$DATA_VS[($_)]</td></tr>\n"; }
237
+	print "</td></tr>\n";
238
+}
239
+
240
+print "</table></blockquote><p>\n";
241
+
242
+print "<input type=hidden name=\"no_check\" value=\"on\">\n";
243
+print "<input type=hidden name=\"ref_page\" value=\"$ref\">\n";
244
+
245
+if ($lct ne "") { print "<input type=hidden name=\"location\" value=\"$lct\">\n"; }
246
+if ($cc eq "on") { print "<input type=hidden name=\"c_copy\" value=\"on\">\n"; }
247
+if ($ref_url ne "") { print "<input type=hidden name=\"ref_url\" value=\"$ref_url\">\n"; }
248
+if ($ref_name ne "") { print "<input type=hidden name=\"ref_name\" value=\"$ref_name\">\n"; }
249
+if ($subject ne "") { print "<input type=hidden name=\"subject\" value=\"$subject\">\n"; }
250
+if ($password ne "") { print "<input type=hidden name=\"password\" value=\"$password\">\n"; }
251
+if ($spam_key ne "") { print "<input type=hidden name=\"spam_key\" value=\"$spam_key\">\n"; }
252
+
253
+if ($email eq '' || $email =~ /\,/) { print "<font size=+2><b>メールアドレスを正しく1つ入力しないと送信できません</b></font><p>\n"; }
254
+else { print "<input type=submit value=\"  送 信  \"><p>\n"; }
255
+
256
+print "</form><p><hr>\n";
257
+print "<i>送信先:<a href=\"mailto:$mailto\">$mailto</a><i>\n";
258
+print "<p>\n";
259
+print <<"EOF";
260
+</span>
261
+<!-- 本文データ ここまで -->
262
+</article>
263
+</section>
264
+</div>
265
+
266
+<script type="text/javascript">
267
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/footer.html");
268
+</script>
269
+
270
+</div>
271
+EOF
272
+print "</body></html>\n";
273
+exit;
274
+
275
+sub sendmail {
276
+
277
+	$email =~ s/\n//g; # 汚染チェック
278
+	if (length($email) > 255) { &error('エラー','メールアドレスの長さ制限は255バイトまでです.'); }
279
+	if ($email =~ /\,/) { &error('エラー','メールアドレスを正しく1つ入力しないと送信できません.'); }
280
+
281
+	$subject =~ s/\n//g; # 汚染チェック
282
+	if (length($subject) > 255) { &error('エラー','メール題名の長さ制限は255バイト(全角はその半分)までです.'); }
283
+
284
+	$host = $ENV{'REMOTE_HOST'};
285
+	$addr = $ENV{'REMOTE_ADDR'};
286
+	if ($host eq "" || $host eq $addr) { $host = gethostbyaddr(pack('C4',split(/\./,$host)),2) || $addr; }
287
+
288
+	if (!(open(OUT,"| $sendmail -t"))) { &error('システム異常','申し訳ありませんが何らかの原因で処理できません.'); }
289
+
290
+	print OUT "X-Mailer: WebFORM v4.4 by CGI-RESCUE\n";
291
+	print OUT "X-HTTP-User-Agent: " . &encTag($ENV{'HTTP_USER_AGENT'}) . "\n";
292
+	print OUT "X-Remote-host: $host \[$addr\]\n";
293
+	$Ref = &decTag($ref); print OUT "X-HTTP-REFERER: $Ref\n";
294
+	print OUT "Errors-To: $mailto\n";
295
+	print OUT "To: $mailto\n";
296
+	print OUT "From: $email\n";
297
+	$Subject = &decTag($subject);
298
+	$Subject = decode('Shift_JIS', $Subject);
299
+	$Subject = encode('JIS', $Subject);
300
+	print OUT "Subject: $Subject\n";
301
+	print OUT "Date: $date_now\n";
302
+	print OUT "Content-Transfer-Encoding: 7bit\n";
303
+	print OUT "Content-Type: text/plain\; charset=\"ISO-2022-JP\"\n\n";
304
+
305
+	$count = @DATA_N;
306
+	foreach (0..$count-1) {
307
+
308
+		if ($DATA_V[$_] =~ /\n/) { &jis("$DATA_N[$_] \n\n$DATA_V[$_]\n"); print OUT "$msg\n\n"; }
309
+		else { &jis("$DATA_N[$_] \n $DATA_V[$_]"); print OUT "$msg\n\n"; }
310
+	}
311
+
312
+	close(OUT);
313
+
314
+	if ($cc eq "on" && $lct ne '') {
315
+
316
+		print "Content-type: text/html\n\n";
317
+print <<"EOF";
318
+<!doctype html>
319
+<html>
320
+<head>
321
+<meta charset="Shift_JIS">
322
+<title>$title</title>
323
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/base.css">
324
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_header.css">
325
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/footer.css">
326
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_section.css">
327
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/third_template.css" >
328
+<script src="http://www.town.kitagata.gifu.jp/kirari/js/include.js"></script>
329
+<meta name="google-translate-customization" content="45643f5d79d6e245-283971e7754d7b90-g905c6e6b6867bf2f-2f"></meta>
330
+</head>
331
+$body
332
+<div id="main" class="gothic">
333
+<!--セクション 操作-->
334
+<script type="text/javascript">
335
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/operation.html");
336
+</script>
337
+
338
+<!--ヘッダーデータ-->
339
+<script type="text/javascript">
340
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header.html");
341
+</script>
342
+
343
+<script type="text/javascript">
344
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header_public.html");
345
+</script>
346
+
347
+<!--セクション ブロック-->
348
+<div id="third_body">
349
+<!--セクション template-->
350
+<section id="template" >
351
+<!-- パンくずリスト -->
352
+<article id="breadcrumb" >
353
+<div id="breadcrumb_title">
354
+<div id="breadcrumb_title_block">
355
+<span id="breadcrumb_title"><a href="../../index.html">トップ</a>><a href="http://www.town.kitagata.gifu.jp/kirari/second/learning_consultation_service_life.html">生涯学習相談窓口</a>>お問い合わせ</span>
356
+</div>
357
+</div>
358
+</article>
359
+<!-- パンくずリスト ここまで -->
360
+<article id="template" >
361
+<div id="template_title" class="gothic">
362
+<div id="template_title_block">
363
+<span id="template_title">お問い合わせ</span>
364
+</div>
365
+</div>
366
+<!-- 大タイトルに本文データが無い場合はこのブロックを消す -->
367
+<span id="template_article_block">
368
+EOF
369
+		print "<h1>送信完了</h1>\n";
370
+		print "ただ今<a href=\"mailto:$mailto\">$mailto</a>宛てに送信された内容は以下の通りです.<br>\n";
371
+		print "内容の写しとしてお控えください.<p>\n";
372
+		print "<form>\n";
373
+		print "<blockquote>\n";
374
+		print "<textarea cols=70 rows=20>";
375
+		&cc;
376
+		print "</textarea></form></blockquote><p>\n";
377
+		print "<h3>[<a href=\"$lct\" target=\"_top\">入力フォームへ戻る</a>]</h3>";
378
+	}
379
+	elsif ($cc eq "on") {
380
+
381
+		print "Content-type: text/html\n\n";
382
+print <<"EOF";
383
+<!doctype html>
384
+<html>
385
+<head>
386
+<meta charset="Shift_JIS">
387
+<title>$title</title>
388
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/base.css">
389
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_header.css">
390
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/footer.css">
391
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_section.css">
392
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/third_template.css" >
393
+<script src="http://www.town.kitagata.gifu.jp/kirari/js/include.js"></script>
394
+<meta name="google-translate-customization" content="45643f5d79d6e245-283971e7754d7b90-g905c6e6b6867bf2f-2f"></meta>
395
+</head>
396
+$body
397
+<div id="main" class="gothic">
398
+<!--セクション 操作-->
399
+<script type="text/javascript">
400
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/operation.html");
401
+</script>
402
+
403
+<!--ヘッダーデータ-->
404
+<script type="text/javascript">
405
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header.html");
406
+</script>
407
+
408
+<script type="text/javascript">
409
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header_public.html");
410
+</script>
411
+
412
+<!--セクション ブロック-->
413
+<div id="third_body">
414
+<!--セクション template-->
415
+<section id="template" >
416
+<!-- パンくずリスト -->
417
+<article id="breadcrumb" >
418
+<div id="breadcrumb_title">
419
+<div id="breadcrumb_title_block">
420
+<span id="breadcrumb_title"><a href="../../index.html">トップ</a>><a href="http://www.town.kitagata.gifu.jp/kirari/second/learning_consultation_service_life.html">生涯学習相談窓口</a>>お問い合わせ</span>
421
+</div>
422
+</div>
423
+</article>
424
+<!-- パンくずリスト ここまで -->
425
+<article id="template" >
426
+<div id="template_title" class="gothic">
427
+<div id="template_title_block">
428
+<span id="template_title">お問い合わせ</span>
429
+</div>
430
+</div>
431
+<!-- 大タイトルに本文データが無い場合はこのブロックを消す -->
432
+<span id="template_article_block">
433
+EOF
434
+		print "<h1>送信完了</h1>\n";
435
+		print "ただ今<a href=\"mailto:$mailto\">$mailto</a>宛てに送信された内容は以下の通りです.<br>\n";
436
+		print "内容の写しとしてお控えください.<p>\n";
437
+		print "<form>\n";
438
+		print "<blockquote>\n";
439
+		print "<textarea cols=70 rows=20>";
440
+		&cc;
441
+		print "</textarea></form></blockquote><p>\n";
442
+		if ($ref_url ne '' && $ref_name ne '') {  print "<h3>[<a href=\"$ref_url\" target=\"_top\">$ref_name</a>]</h3>"; }
443
+print <<"EOF";
444
+</span>
445
+<!-- 本文データ ここまで -->
446
+</article>
447
+</section>
448
+</div>
449
+
450
+<script type="text/javascript">
451
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/footer.html");
452
+</script>
453
+
454
+</div>
455
+EOF
456
+		print "</body></html>\n";
457
+	}
458
+	elsif ($lct ne '') { print "Location: $lct\n\n"; }
459
+	else {
460
+		print "Content-type: text/html\n\n";
461
+print <<"EOF";
462
+<!doctype html>
463
+<html>
464
+<head>
465
+<meta charset="Shift_JIS">
466
+<title>$title</title>
467
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/base.css">
468
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_header.css">
469
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/footer.css">
470
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_section.css">
471
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/third_template.css" >
472
+<script src="http://www.town.kitagata.gifu.jp/kirari/js/include.js"></script>
473
+<meta name="google-translate-customization" content="45643f5d79d6e245-283971e7754d7b90-g905c6e6b6867bf2f-2f"></meta>
474
+</head>
475
+$body
476
+<div id="main" class="gothic">
477
+<!--セクション 操作-->
478
+<script type="text/javascript">
479
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/operation.html");
480
+</script>
481
+
482
+<!--ヘッダーデータ-->
483
+<script type="text/javascript">
484
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header.html");
485
+</script>
486
+
487
+<script type="text/javascript">
488
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header_public.html");
489
+</script>
490
+
491
+<!--セクション ブロック-->
492
+<div id="third_body">
493
+<!--セクション template-->
494
+<section id="template" >
495
+<!-- パンくずリスト -->
496
+<article id="breadcrumb" >
497
+<div id="breadcrumb_title">
498
+<div id="breadcrumb_title_block">
499
+<span id="breadcrumb_title"><a href="../../index.html">トップ</a>><a href="http://www.town.kitagata.gifu.jp/kirari/second/learning_consultation_service_life.html">生涯学習相談窓口</a>>お問い合わせ</span>
500
+</div>
501
+</div>
502
+</article>
503
+<!-- パンくずリスト ここまで -->
504
+<article id="template" >
505
+<div id="template_title" class="gothic">
506
+<div id="template_title_block">
507
+<span id="template_title">お問い合わせ</span>
508
+</div>
509
+</div>
510
+<!-- 大タイトルに本文データが無い場合はこのブロックを消す -->
511
+<span id="template_article_block">
512
+EOF
513
+		print "<H1>送信完了</H1>\n";
514
+		print "ご記入されたものは<a href=\"mailto:$mailto\">$mailto</a>宛てに電子メールされました.<br>\n";
515
+		print "Thank you for sending comments to $mailto .<p>\n";
516
+		if ($ref_url ne '' && $ref_name ne '') {  print "<h3>[<a href=\"$ref_url\" target=\"_top\">$ref_name</a>]</h3>"; }
517
+print <<"EOF";
518
+</span>
519
+<!-- 本文データ ここまで -->
520
+</article>
521
+</section>
522
+</div>
523
+
524
+<script type="text/javascript">
525
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/footer.html");
526
+</script>
527
+
528
+</div>
529
+EOF
530
+		print "<p></body></html>\n";
531
+	}
532
+	exit;
533
+}
534
+
535
+sub cc {
536
+
537
+	print "Date: $date_now\n";
538
+	print "To: $mailto\n";
539
+	print "Subject: $subject\n\n";
540
+
541
+	foreach (0..$count-1) {
542
+
543
+		if ($DATA_VS[$_] =~ /\n/) { print "$DATA_NS[$_] \n\n$DATA_VS[$_]\n\n"; }
544
+		else { print "$DATA_NS[$_] \n $DATA_VS[$_]\n\n"; }
545
+	}
546
+}
547
+
548
+sub jis {
549
+
550
+	$msg = $_[0];
551
+	local(@msg);
552
+
553
+	@msg = split(/\n/,$msg);
554
+	foreach $i (0..$#msg) {
555
+
556
+		if ($msg[$i] eq '.') { splice(@msg,$i,1,'..'); }
557
+	}
558
+
559
+	$msg = join("\n",@msg);
560
+
561
+	#&jcode'convert(*msg, 'jis');
562
+	#&jcode'convert(*msg, 'sjis');
563
+	#jcode::convert(\$msg, 'jis');
564
+	#jcode::convert($msg, 'jis');
565
+
566
+	from_to($msg,'Shift_JIS', 'JIS');
567
+	#from_to($msg,'UTF-8', 'JIS');
568
+
569
+	#from_to($msg,'Shift_JIS', 'Shift_JIS');
570
+	#from_to($msg,'UTF-8', 'Shift_JIS');
571
+	
572
+#	my $env = jcode::getcode(*msg);
573
+#	if ( $env eq "sjis" ) {
574
+#		from_to($msg,'Shift_JIS', 'JIS');
575
+#	} else { 
576
+#		from_to($msg,'UTF-8', 'JIS');
577
+#	}
578
+
579
+}
580
+
581
+sub encTag {
582
+
583
+	local($line) = $_[0];
584
+	$line =~ s/"/&quot;/g;
585
+	$line =~ s/</&lt;/g;
586
+	$line =~ s/>/&gt;/g;
587
+	$line;
588
+}
589
+
590
+sub decTag {
591
+
592
+	local($line) = $_[0];
593
+	$line =~ s/&quot;/"/g;
594
+	$line =~ s/&lt;/</g;
595
+	$line =~ s/&gt;/>/g;
596
+	$line;
597
+}
598
+
599
+sub error {
600
+
601
+	print "Content-type: text/html\n\n";
602
+print <<"EOF";
603
+<!doctype html>
604
+<html>
605
+<head>
606
+<meta charset="Shift_JIS">
607
+<title>$title</title>
608
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/base.css">
609
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_header.css">
610
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/footer.css">
611
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_section.css">
612
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/third_template.css" >
613
+<script src="http://www.town.kitagata.gifu.jp/kirari/js/include.js"></script>
614
+<meta name="google-translate-customization" content="45643f5d79d6e245-283971e7754d7b90-g905c6e6b6867bf2f-2f"></meta>
615
+</head>
616
+$body
617
+<div id="main" class="gothic">
618
+<!--セクション 操作-->
619
+<script type="text/javascript">
620
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/operation.html");
621
+</script>
622
+
623
+<!--ヘッダーデータ-->
624
+<script type="text/javascript">
625
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header.html");
626
+</script>
627
+
628
+<script type="text/javascript">
629
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header_public.html");
630
+</script>
631
+
632
+<!--セクション ブロック-->
633
+<div id="third_body">
634
+<!--セクション template-->
635
+<section id="template" >
636
+<!-- パンくずリスト -->
637
+<article id="breadcrumb" >
638
+<div id="breadcrumb_title">
639
+<div id="breadcrumb_title_block">
640
+<span id="breadcrumb_title"><a href="../../index.html">トップ</a>><a href="http://www.town.kitagata.gifu.jp/kirari/second/learning_consultation_service_life.html">生涯学習相談窓口</a>>お問い合わせ</span>
641
+</div>
642
+</div>
643
+</article>
644
+<!-- パンくずリスト ここまで -->
645
+<article id="template" >
646
+<div id="template_title" class="gothic">
647
+<div id="template_title_block">
648
+<span id="template_title">お問い合わせ</span>
649
+</div>
650
+</div>
651
+<!-- 大タイトルに本文データが無い場合はこのブロックを消す -->
652
+<span id="template_article_block">
653
+EOF
654
+        print "<h1>$_[0]</h1>\n";
655
+	print "<h3>$_[1]</h3>\n";
656
+
657
+	if ($ref eq '') {
658
+
659
+		print "※ フォームページが取得できません.<br>\n";
660
+		print "※ ブラウザの[戻る]ボタンを押して前の画面に移動してください.<p>\n";
661
+	}
662
+	else {
663
+
664
+		print "※ フォームページ <a href=\"$ref\">$ref</a><br>\n";
665
+		print "※ フォームページへ戻るか、ブラウザの[戻る]ボタンを押して前の画面に移動してください.<p>\n";
666
+	}
667
+
668
+print "<p>\n";
669
+print <<"EOF";
670
+</span>
671
+<!-- 本文データ ここまで -->
672
+</article>
673
+</section>
674
+</div>
675
+
676
+<script type="text/javascript">
677
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/footer.html");
678
+</script>
679
+
680
+</div>
681
+EOF
682
+print "</body></html>\n";
683
+	exit;
684
+}

+ 683
- 0
cgi-bin/mail/webform_kirari_.cgi 查看文件

@@ -0,0 +1,683 @@
1
+#!/usr/bin/perl
2
+
3
+;##########################################################################
4
+;#
5
+;# WebFORM v4.4 <フリーソフト>
6
+;#
7
+;#  (c)CGI-RESCUE
8
+;#  http://www.rescue.ne.jp/
9
+;#
10
+;# Hostory
11
+;# 06/Jun/1998 v3.0 セキュリティ強化
12
+;# 08/Aug/1998 v3.1 カーボンコピー処理改善
13
+;# 29/Oct/1998 v4.0 カーボンコピー処理はセキュリティの問題で廃止
14
+;# 16/Feb/2006 v4.1 スパムに対する脆弱性を修正
15
+;# 08/Jul/2006 v4.2 スパムに対する脆弱性を修正(v4.1の修正ミスを修正)
16
+;# 13/Nov/2006 v4.3 スパムメール防止機能を追加(スパムキー機能)
17
+;# 18/Jan/2007 v4.4 スパムに対する脆弱性を修正、およびSENDMAILの誤作動データの置換処理
18
+;#
19
+;##########################################################################
20
+
21
+#------ 初期設定 ----------------------------------------------------------
22
+
23
+#use Jcode;
24
+#use Encode;
25
+use Encode 'from_to';
26
+use Encode 'encode';
27
+use Encode 'decode';
28
+use MIME::Base64;
29
+
30
+#■日本語コード変換ライブラリ
31
+require './jacode.pl';
32
+
33
+#■SENDMAILの設定
34
+$sendmail = '/usr/lib/sendmail';
35
+
36
+#■受信先メールアドレス
37
+$mailto = 'kuni.takenaka@gmail.com';
38
+
39
+#■名称
40
+$title = 'メール送信';
41
+
42
+#■画面のボディ設定
43
+$body = '<body id="back">';
44
+
45
+#■記入者メールアドレス( name="email"の時 )未入力でも送信する  1:する 0:しない
46
+#  メールアドレスはあくまでも記入者の申告であり、正しいかどうかは分かりません。
47
+$mailcheck = 0;
48
+
49
+#■タイトル欄に入力がない場合のデフォルト値
50
+#$subject = '- NO SUBJECT -';
51
+$subject = "お問い合わせ";
52
+
53
+#■スパムキー機能を使う場合のキーワード設定
54
+#
55
+#  画面に表示した単語、文章、文字列を入力させたり、それを画像にしたものを入力させる(目の不自由な方には対応できないことに留意)、
56
+#  または質問の答えを書かせるなどして、このCGIの送信機能を悪用して自動で送信してくるスパムを、
57
+#  自動(ロボット)では処理できない段取りを挿入することにより防止する機能です。
58
+#
59
+#  スパムキー <input type="text" name="spam_key">
60
+#
61
+#  のように、「name=」を「spam_key」にして入力した内容は、CGI内に設定したキーワードと
62
+# 「一致」(半角・全角・大文字・小文字などは区別される)しなければ送信しないという機能です。
63
+#  これを設定しても、CGI内にキーワードを設定しない場合は設定エラーになります。キーワードを設定しても、フォームに設定しない場合は無視されます。
64
+#  キーワードは '' の間に設定してください。例:'日本' 例:'123'
65
+
66
+$spam_base_key = '';
67
+
68
+#--------------------------------------------------------------------------
69
+
70
+### 時刻取得
71
+($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
72
+@mon_array = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
73
+@wday_array = ('Sun','Mon','Tue','Wed','Thu','Fri','Sat');
74
+$date_now = sprintf("%s, %02d %s %04d %02d:%02d:%02d +0900 (JST)",$wday_array[$wday],$mday,$mon_array[$mon],$year +1900,$hour,$min,$sec); # JSTは日本標準時という意味です
75
+
76
+### データ入力
77
+if ($ENV{'REQUEST_METHOD'} ne "POST") { &error('エラー','標準入力 METHOD=POST でご利用ください.'); }
78
+read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
79
+if ($buffer eq '') { &error('エラー','このプログラムは直接起動できません.','使い方を確認してください.'); }
80
+$ref = &encTag($ENV{'HTTP_REFERER'});
81
+$buffer2 = $ENV{'QUERY_STRING'};
82
+if ($buffer2 ne '') { &error('エラー','標準入力 METHOD=POST でご利用ください.','または、クエリーにデータが検出されました.'); }
83
+
84
+
85
+### デコード
86
+@pairs = split(/&/,$buffer);
87
+foreach $pair (@pairs) {
88
+
89
+	($name,$value) = split(/=/,$pair);
90
+	$value =~ tr/+/ /;
91
+	$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
92
+	$name =~ tr/+/ /;
93
+	$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg;
94
+
95
+	#&jcode'convert(*name,'jis'); &jcode'convert(*value,'jis');
96
+	#jcode::convert(*name,'sjis'); jcode::convert(*value,'sjis');
97
+	#jcode::convert(*name,'jis'); jcode::convert(*value,'jis');
98
+
99
+	#from_to($name, 'UTF-8', 'Shift_JIS'); from_to($value, 'UTF-8', 'Shift_JIS');
100
+	$env = jcode::getcode(*name);
101
+	if ($name eq "subject") {
102
+		$env = jcode::getcode(*value);
103
+	}
104
+	if ( $env eq "sjis" ) {
105
+		#from_to($name, 'Shift_JIS', 'UTF-8'); from_to($value, 'Shift_JIS', 'UTF-8');
106
+		#from_to($name, 'Shift_JIS', 'Shift_JIS'); from_to($value, 'Shift_JIS', 'Shift_JIS');
107
+		$name = decode('Shift_JIS', $name); $value = decode('Shift_JIS', $value);
108
+	} else { 
109
+		#from_to($name, 'UTF-8', 'Shift_JIS'); from_to($value, 'UTF-8', 'Shift_JIS');
110
+		$name = decode('UTF-8', $name); $value = decode('UTF-8', $value);
111
+	}
112
+	$name = encode('Shift_JIS', $name); $value = encode('Shift_JIS', $value);
113
+
114
+	#$value =~ s/http/"><s>te&st<\/s>/;#debug用
115
+
116
+	if ($value =~ /\r\n/) { $value =~ s/\r//g; } # 改行コードをUNIX(\n)に統一
117
+	elsif ($value =~ /\r/) { $value =~ s/\r/\n/g; }
118
+
119
+	if ($name eq "location") { $lct = &encTag($value); }
120
+	elsif ($name eq "c_copy" && $value eq "on") { $cc = "on"; }
121
+	elsif ($name eq "no_check" && $value eq "on") { $nocheck = "on"; }
122
+	elsif ($name eq "space_check" && $value eq "on") { $spcheck = "on"; }
123
+	elsif ($name eq "no_check") { ; }
124
+	elsif ($name eq "ref_url") { $ref_url = &encTag($value); }
125
+	elsif ($name eq "ref_name") { $ref_name = &encTag($value); }
126
+	elsif ($name eq "spam_key") { $spam_key = $value; $spam = 1; }
127
+	elsif ($name eq "subject" && $value ne "") { $subject = $value; }
128
+	elsif ($name eq "subject") { ; }
129
+	elsif ($name eq "ref_page") { $ref = &encTag($value); }
130
+	elsif ($name eq "password") {
131
+
132
+		$password = $value;
133
+		push(@DATA_N,$name);
134
+		push(@DATA_V,$value);
135
+	}
136
+	else {
137
+		if ($name =~ /^email/i || $name =~ /^e\-mail/i) {
138
+
139
+			$value =~ s/ / /g;
140
+			if ($value =~ / / || $value =~ /;/) { $value = ""; }
141
+			if (!($value =~ /(.*)\@(.*)\.(.*)/)) { $value = ""; }
142
+
143
+			$email = $value;
144
+		}
145
+
146
+		push(@DATA_N,$name);
147
+		push(@DATA_V,$value);
148
+
149
+		$name = &encTag($name);
150
+		$value = &encTag($value);
151
+		push(@DATA_NS,$name);
152
+		push(@DATA_VS,$value);
153
+	}
154
+}
155
+
156
+### 入力チェック
157
+$ref =~ s/\n|\r//g; # 汚染チェック
158
+$lct =~ s/\n|\r//g; # 汚染チェック
159
+if (!$mailcheck && $email eq '') { &error('エラー','Eメールを入力してください.'); }
160
+if ($mailcheck && $email eq '') { $email = 'anonymous@on.the.net'; } # メール未記入でも送信する場合の仮メールアドレス
161
+if ($spcheck eq "on") {	foreach (@DATA_V) { if ($_ eq "") { &error('送信できません','受信者の意向により、全ての項目を埋めないと送信できません.'); } }}
162
+if ($mailto eq '' || !($mailto =~ /(.*)\@(.*)\.(.*)/)) { &error('設定ミス','受信先メールアドレスが設定されていません.'); }
163
+if ($spam_base_key eq '' && $spam) { &error('設定ミス','スパムキー用のキーワードが設定されていません.'); }
164
+if ($spam_base_key ne '' && $spam_base_key ne $spam_key) { &error('送信できません','画面に書かれていることに従ってキーワードを入力してください.'); }
165
+if ($nocheck eq "on") { &sendmail; } # 確認画面を出さずに送信へ
166
+
167
+### 内容確認画面出力
168
+print "Content-type: text/html\n\n";
169
+print <<"EOF";
170
+<!doctype html>
171
+<html>
172
+<head>
173
+<meta charset="Shift_JIS">
174
+<title>$title</title>
175
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/base.css">
176
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_header.css">
177
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/footer.css">
178
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_section.css">
179
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/third_template.css" >
180
+<script src="http://www.town.kitagata.gifu.jp/kirari/js/include.js"></script>
181
+<meta name="google-translate-customization" content="45643f5d79d6e245-283971e7754d7b90-g905c6e6b6867bf2f-2f"></meta>
182
+</head>
183
+$body
184
+<div id="main" class="gothic">
185
+<!--セクション 操作-->
186
+<script type="text/javascript">
187
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/operation.html");
188
+</script>
189
+
190
+<!--ヘッダーデータ-->
191
+<script type="text/javascript">
192
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header.html");
193
+</script>
194
+
195
+<script type="text/javascript">
196
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header_public.html");
197
+</script>
198
+
199
+<!--セクション ブロック-->
200
+<div id="third_body">
201
+<!--セクション template-->
202
+<section id="template" >
203
+<!-- パンくずリスト -->
204
+<article id="breadcrumb" >
205
+<div id="breadcrumb_title">
206
+<div id="breadcrumb_title_block">
207
+<span id="breadcrumb_title"><a href="../../index.html">トップ</a>><a href="http://www.town.kitagata.gifu.jp/kirari/second/learning_consultation_service_life.html">生涯学習相談窓口</a>>お問い合わせ</span>
208
+</div>
209
+</div>
210
+</article>
211
+<!-- パンくずリスト ここまで -->
212
+<article id="template" >
213
+<div id="template_title" class="gothic">
214
+<div id="template_title_block">
215
+<span id="template_title">お問い合わせ</span>
216
+</div>
217
+</div>
218
+<!-- 大タイトルに本文データが無い場合はこのブロックを消す -->
219
+<span id="template_article_block">
220
+<h1>内容確認</h1>
221
+<form method="POST" action="webform_kirari.cgi">
222
+<blockquote>
223
+<table border=0 cellpadding=3 cellspacing=3>
224
+<tr><td bgcolor="#ffcccc"><b><font size=+1>項目</font></b></td><td bgcolor="#ffcccc"><b><font size=+1>内容</font></b></td></tr>
225
+EOF
226
+
227
+$count = @DATA_NS;
228
+
229
+foreach (0..$count-1) {
230
+
231
+	print "<input type=hidden name=\"$DATA_NS[($_)]\" value=\"$DATA_VS[($_)]\">\n";
232
+	print "<tr><td bgcolor=\"#ffeedd\">$DATA_NS[($_)] <br></td>";
233
+
234
+	if ($DATA_VS[($_)] =~ /\n/) { print "<td bgcolor=\"#ffffff\"><pre>$DATA_VS[($_)]</pre></td></tr>\n"; }
235
+	else { print "<td bgcolor=\"#ffffff\">$DATA_VS[($_)]</td></tr>\n"; }
236
+	print "</td></tr>\n";
237
+}
238
+
239
+print "</table></blockquote><p>\n";
240
+
241
+print "<input type=hidden name=\"no_check\" value=\"on\">\n";
242
+print "<input type=hidden name=\"ref_page\" value=\"$ref\">\n";
243
+
244
+if ($lct ne "") { print "<input type=hidden name=\"location\" value=\"$lct\">\n"; }
245
+if ($cc eq "on") { print "<input type=hidden name=\"c_copy\" value=\"on\">\n"; }
246
+if ($ref_url ne "") { print "<input type=hidden name=\"ref_url\" value=\"$ref_url\">\n"; }
247
+if ($ref_name ne "") { print "<input type=hidden name=\"ref_name\" value=\"$ref_name\">\n"; }
248
+if ($subject ne "") { print "<input type=hidden name=\"subject\" value=\"$subject\">\n"; }
249
+if ($password ne "") { print "<input type=hidden name=\"password\" value=\"$password\">\n"; }
250
+if ($spam_key ne "") { print "<input type=hidden name=\"spam_key\" value=\"$spam_key\">\n"; }
251
+
252
+if ($email eq '' || $email =~ /\,/) { print "<font size=+2><b>メールアドレスを正しく1つ入力しないと送信できません</b></font><p>\n"; }
253
+else { print "<input type=submit value=\"  送 信  \"><p>\n"; }
254
+
255
+print "</form><p><hr>\n";
256
+print "<i>送信先:<a href=\"mailto:$mailto\">$mailto</a><i>\n";
257
+print "<p>\n";
258
+print <<"EOF";
259
+</span>
260
+<!-- 本文データ ここまで -->
261
+</article>
262
+</section>
263
+</div>
264
+
265
+<script type="text/javascript">
266
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/footer.html");
267
+</script>
268
+
269
+</div>
270
+EOF
271
+print "</body></html>\n";
272
+exit;
273
+
274
+sub sendmail {
275
+
276
+	$email =~ s/\n//g; # 汚染チェック
277
+	if (length($email) > 255) { &error('エラー','メールアドレスの長さ制限は255バイトまでです.'); }
278
+	if ($email =~ /\,/) { &error('エラー','メールアドレスを正しく1つ入力しないと送信できません.'); }
279
+
280
+	$subject =~ s/\n//g; # 汚染チェック
281
+	if (length($subject) > 255) { &error('エラー','メール題名の長さ制限は255バイト(全角はその半分)までです.'); }
282
+
283
+	$host = $ENV{'REMOTE_HOST'};
284
+	$addr = $ENV{'REMOTE_ADDR'};
285
+	if ($host eq "" || $host eq $addr) { $host = gethostbyaddr(pack('C4',split(/\./,$host)),2) || $addr; }
286
+
287
+	if (!(open(OUT,"| $sendmail -t"))) { &error('システム異常','申し訳ありませんが何らかの原因で処理できません.'); }
288
+
289
+	print OUT "X-Mailer: WebFORM v4.4 by CGI-RESCUE\n";
290
+	print OUT "X-HTTP-User-Agent: " . &encTag($ENV{'HTTP_USER_AGENT'}) . "\n";
291
+	print OUT "X-Remote-host: $host \[$addr\]\n";
292
+	$Ref = &decTag($ref); print OUT "X-HTTP-REFERER: $Ref\n";
293
+	print OUT "Errors-To: $mailto\n";
294
+	print OUT "To: $mailto\n";
295
+	print OUT "From: $email\n";
296
+	$Subject = &decTag($subject);
297
+	$Subject = decode('Shift_JIS', $Subject);
298
+	$Subject = encode('JIS', $Subject);
299
+	print OUT "Subject: $Subject\n";
300
+	print OUT "Date: $date_now\n";
301
+	print OUT "Content-Transfer-Encoding: 7bit\n";
302
+	print OUT "Content-Type: text/plain\; charset=\"ISO-2022-JP\"\n\n";
303
+
304
+	$count = @DATA_N;
305
+	foreach (0..$count-1) {
306
+
307
+		if ($DATA_V[$_] =~ /\n/) { &jis("$DATA_N[$_] \n\n$DATA_V[$_]\n"); print OUT "$msg\n\n"; }
308
+		else { &jis("$DATA_N[$_] \n $DATA_V[$_]"); print OUT "$msg\n\n"; }
309
+	}
310
+
311
+	close(OUT);
312
+
313
+	if ($cc eq "on" && $lct ne '') {
314
+
315
+		print "Content-type: text/html\n\n";
316
+print <<"EOF";
317
+<!doctype html>
318
+<html>
319
+<head>
320
+<meta charset="Shift_JIS">
321
+<title>$title</title>
322
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/base.css">
323
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_header.css">
324
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/footer.css">
325
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_section.css">
326
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/third_template.css" >
327
+<script src="http://www.town.kitagata.gifu.jp/kirari/js/include.js"></script>
328
+<meta name="google-translate-customization" content="45643f5d79d6e245-283971e7754d7b90-g905c6e6b6867bf2f-2f"></meta>
329
+</head>
330
+$body
331
+<div id="main" class="gothic">
332
+<!--セクション 操作-->
333
+<script type="text/javascript">
334
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/operation.html");
335
+</script>
336
+
337
+<!--ヘッダーデータ-->
338
+<script type="text/javascript">
339
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header.html");
340
+</script>
341
+
342
+<script type="text/javascript">
343
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header_public.html");
344
+</script>
345
+
346
+<!--セクション ブロック-->
347
+<div id="third_body">
348
+<!--セクション template-->
349
+<section id="template" >
350
+<!-- パンくずリスト -->
351
+<article id="breadcrumb" >
352
+<div id="breadcrumb_title">
353
+<div id="breadcrumb_title_block">
354
+<span id="breadcrumb_title"><a href="../../index.html">トップ</a>><a href="http://www.town.kitagata.gifu.jp/kirari/second/learning_consultation_service_life.html">生涯学習相談窓口</a>>お問い合わせ</span>
355
+</div>
356
+</div>
357
+</article>
358
+<!-- パンくずリスト ここまで -->
359
+<article id="template" >
360
+<div id="template_title" class="gothic">
361
+<div id="template_title_block">
362
+<span id="template_title">お問い合わせ</span>
363
+</div>
364
+</div>
365
+<!-- 大タイトルに本文データが無い場合はこのブロックを消す -->
366
+<span id="template_article_block">
367
+EOF
368
+		print "<h1>送信完了</h1>\n";
369
+		print "ただ今<a href=\"mailto:$mailto\">$mailto</a>宛てに送信された内容は以下の通りです.<br>\n";
370
+		print "内容の写しとしてお控えください.<p>\n";
371
+		print "<form>\n";
372
+		print "<blockquote>\n";
373
+		print "<textarea cols=70 rows=20>";
374
+		&cc;
375
+		print "</textarea></form></blockquote><p>\n";
376
+		print "<h3>[<a href=\"$lct\" target=\"_top\">入力フォームへ戻る</a>]</h3>";
377
+	}
378
+	elsif ($cc eq "on") {
379
+
380
+		print "Content-type: text/html\n\n";
381
+print <<"EOF";
382
+<!doctype html>
383
+<html>
384
+<head>
385
+<meta charset="Shift_JIS">
386
+<title>$title</title>
387
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/base.css">
388
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_header.css">
389
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/footer.css">
390
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_section.css">
391
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/third_template.css" >
392
+<script src="http://www.town.kitagata.gifu.jp/kirari/js/include.js"></script>
393
+<meta name="google-translate-customization" content="45643f5d79d6e245-283971e7754d7b90-g905c6e6b6867bf2f-2f"></meta>
394
+</head>
395
+$body
396
+<div id="main" class="gothic">
397
+<!--セクション 操作-->
398
+<script type="text/javascript">
399
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/operation.html");
400
+</script>
401
+
402
+<!--ヘッダーデータ-->
403
+<script type="text/javascript">
404
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header.html");
405
+</script>
406
+
407
+<script type="text/javascript">
408
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header_public.html");
409
+</script>
410
+
411
+<!--セクション ブロック-->
412
+<div id="third_body">
413
+<!--セクション template-->
414
+<section id="template" >
415
+<!-- パンくずリスト -->
416
+<article id="breadcrumb" >
417
+<div id="breadcrumb_title">
418
+<div id="breadcrumb_title_block">
419
+<span id="breadcrumb_title"><a href="../../index.html">トップ</a>><a href="http://www.town.kitagata.gifu.jp/kirari/second/learning_consultation_service_life.html">生涯学習相談窓口</a>>お問い合わせ</span>
420
+</div>
421
+</div>
422
+</article>
423
+<!-- パンくずリスト ここまで -->
424
+<article id="template" >
425
+<div id="template_title" class="gothic">
426
+<div id="template_title_block">
427
+<span id="template_title">お問い合わせ</span>
428
+</div>
429
+</div>
430
+<!-- 大タイトルに本文データが無い場合はこのブロックを消す -->
431
+<span id="template_article_block">
432
+EOF
433
+		print "<h1>送信完了</h1>\n";
434
+		print "ただ今<a href=\"mailto:$mailto\">$mailto</a>宛てに送信された内容は以下の通りです.<br>\n";
435
+		print "内容の写しとしてお控えください.<p>\n";
436
+		print "<form>\n";
437
+		print "<blockquote>\n";
438
+		print "<textarea cols=70 rows=20>";
439
+		&cc;
440
+		print "</textarea></form></blockquote><p>\n";
441
+		if ($ref_url ne '' && $ref_name ne '') {  print "<h3>[<a href=\"$ref_url\" target=\"_top\">$ref_name</a>]</h3>"; }
442
+print <<"EOF";
443
+</span>
444
+<!-- 本文データ ここまで -->
445
+</article>
446
+</section>
447
+</div>
448
+
449
+<script type="text/javascript">
450
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/footer.html");
451
+</script>
452
+
453
+</div>
454
+EOF
455
+		print "</body></html>\n";
456
+	}
457
+	elsif ($lct ne '') { print "Location: $lct\n\n"; }
458
+	else {
459
+		print "Content-type: text/html\n\n";
460
+print <<"EOF";
461
+<!doctype html>
462
+<html>
463
+<head>
464
+<meta charset="Shift_JIS">
465
+<title>$title</title>
466
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/base.css">
467
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_header.css">
468
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/footer.css">
469
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_section.css">
470
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/third_template.css" >
471
+<script src="http://www.town.kitagata.gifu.jp/kirari/js/include.js"></script>
472
+<meta name="google-translate-customization" content="45643f5d79d6e245-283971e7754d7b90-g905c6e6b6867bf2f-2f"></meta>
473
+</head>
474
+$body
475
+<div id="main" class="gothic">
476
+<!--セクション 操作-->
477
+<script type="text/javascript">
478
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/operation.html");
479
+</script>
480
+
481
+<!--ヘッダーデータ-->
482
+<script type="text/javascript">
483
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header.html");
484
+</script>
485
+
486
+<script type="text/javascript">
487
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header_public.html");
488
+</script>
489
+
490
+<!--セクション ブロック-->
491
+<div id="third_body">
492
+<!--セクション template-->
493
+<section id="template" >
494
+<!-- パンくずリスト -->
495
+<article id="breadcrumb" >
496
+<div id="breadcrumb_title">
497
+<div id="breadcrumb_title_block">
498
+<span id="breadcrumb_title"><a href="../../index.html">トップ</a>><a href="http://www.town.kitagata.gifu.jp/kirari/second/learning_consultation_service_life.html">生涯学習相談窓口</a>>お問い合わせ</span>
499
+</div>
500
+</div>
501
+</article>
502
+<!-- パンくずリスト ここまで -->
503
+<article id="template" >
504
+<div id="template_title" class="gothic">
505
+<div id="template_title_block">
506
+<span id="template_title">お問い合わせ</span>
507
+</div>
508
+</div>
509
+<!-- 大タイトルに本文データが無い場合はこのブロックを消す -->
510
+<span id="template_article_block">
511
+EOF
512
+		print "<H1>送信完了</H1>\n";
513
+		print "ご記入されたものは<a href=\"mailto:$mailto\">$mailto</a>宛てに電子メールされました.<br>\n";
514
+		print "Thank you for sending comments to $mailto .<p>\n";
515
+		if ($ref_url ne '' && $ref_name ne '') {  print "<h3>[<a href=\"$ref_url\" target=\"_top\">$ref_name</a>]</h3>"; }
516
+print <<"EOF";
517
+</span>
518
+<!-- 本文データ ここまで -->
519
+</article>
520
+</section>
521
+</div>
522
+
523
+<script type="text/javascript">
524
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/footer.html");
525
+</script>
526
+
527
+</div>
528
+EOF
529
+		print "<p></body></html>\n";
530
+	}
531
+	exit;
532
+}
533
+
534
+sub cc {
535
+
536
+	print "Date: $date_now\n";
537
+	print "To: $mailto\n";
538
+	print "Subject: $subject\n\n";
539
+
540
+	foreach (0..$count-1) {
541
+
542
+		if ($DATA_VS[$_] =~ /\n/) { print "$DATA_NS[$_] \n\n$DATA_VS[$_]\n\n"; }
543
+		else { print "$DATA_NS[$_] \n $DATA_VS[$_]\n\n"; }
544
+	}
545
+}
546
+
547
+sub jis {
548
+
549
+	$msg = $_[0];
550
+	local(@msg);
551
+
552
+	@msg = split(/\n/,$msg);
553
+	foreach $i (0..$#msg) {
554
+
555
+		if ($msg[$i] eq '.') { splice(@msg,$i,1,'..'); }
556
+	}
557
+
558
+	$msg = join("\n",@msg);
559
+
560
+	#&jcode'convert(*msg, 'jis');
561
+	#&jcode'convert(*msg, 'sjis');
562
+	#jcode::convert(\$msg, 'jis');
563
+	#jcode::convert($msg, 'jis');
564
+
565
+	from_to($msg,'Shift_JIS', 'JIS');
566
+	#from_to($msg,'UTF-8', 'JIS');
567
+
568
+	#from_to($msg,'Shift_JIS', 'Shift_JIS');
569
+	#from_to($msg,'UTF-8', 'Shift_JIS');
570
+	
571
+#	my $env = jcode::getcode(*msg);
572
+#	if ( $env eq "sjis" ) {
573
+#		from_to($msg,'Shift_JIS', 'JIS');
574
+#	} else { 
575
+#		from_to($msg,'UTF-8', 'JIS');
576
+#	}
577
+
578
+}
579
+
580
+sub encTag {
581
+
582
+	local($line) = $_[0];
583
+	$line =~ s/"/&quot;/g;
584
+	$line =~ s/</&lt;/g;
585
+	$line =~ s/>/&gt;/g;
586
+	$line;
587
+}
588
+
589
+sub decTag {
590
+
591
+	local($line) = $_[0];
592
+	$line =~ s/&quot;/"/g;
593
+	$line =~ s/&lt;/</g;
594
+	$line =~ s/&gt;/>/g;
595
+	$line;
596
+}
597
+
598
+sub error {
599
+
600
+	print "Content-type: text/html\n\n";
601
+print <<"EOF";
602
+<!doctype html>
603
+<html>
604
+<head>
605
+<meta charset="Shift_JIS">
606
+<title>$title</title>
607
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/base.css">
608
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_header.css">
609
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/footer.css">
610
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/second_section.css">
611
+<link rel="stylesheet" href="http://www.town.kitagata.gifu.jp/kirari/css/third_template.css" >
612
+<script src="http://www.town.kitagata.gifu.jp/kirari/js/include.js"></script>
613
+<meta name="google-translate-customization" content="45643f5d79d6e245-283971e7754d7b90-g905c6e6b6867bf2f-2f"></meta>
614
+</head>
615
+$body
616
+<div id="main" class="gothic">
617
+<!--セクション 操作-->
618
+<script type="text/javascript">
619
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/operation.html");
620
+</script>
621
+
622
+<!--ヘッダーデータ-->
623
+<script type="text/javascript">
624
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header.html");
625
+</script>
626
+
627
+<script type="text/javascript">
628
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/header_public.html");
629
+</script>
630
+
631
+<!--セクション ブロック-->
632
+<div id="third_body">
633
+<!--セクション template-->
634
+<section id="template" >
635
+<!-- パンくずリスト -->
636
+<article id="breadcrumb" >
637
+<div id="breadcrumb_title">
638
+<div id="breadcrumb_title_block">
639
+<span id="breadcrumb_title"><a href="../../index.html">トップ</a>><a href="http://www.town.kitagata.gifu.jp/kirari/second/learning_consultation_service_life.html">生涯学習相談窓口</a>>お問い合わせ</span>
640
+</div>
641
+</div>
642
+</article>
643
+<!-- パンくずリスト ここまで -->
644
+<article id="template" >
645
+<div id="template_title" class="gothic">
646
+<div id="template_title_block">
647
+<span id="template_title">お問い合わせ</span>
648
+</div>
649
+</div>
650
+<!-- 大タイトルに本文データが無い場合はこのブロックを消す -->
651
+<span id="template_article_block">
652
+EOF
653
+        print "<h1>$_[0]</h1>\n";
654
+	print "<h3>$_[1]</h3>\n";
655
+
656
+	if ($ref eq '') {
657
+
658
+		print "※ フォームページが取得できません.<br>\n";
659
+		print "※ ブラウザの[戻る]ボタンを押して前の画面に移動してください.<p>\n";
660
+	}
661
+	else {
662
+
663
+		print "※ フォームページ <a href=\"$ref\">$ref</a><br>\n";
664
+		print "※ フォームページへ戻るか、ブラウザの[戻る]ボタンを押して前の画面に移動してください.<p>\n";
665
+	}
666
+
667
+print "<p>\n";
668
+print <<"EOF";
669
+</span>
670
+<!-- 本文データ ここまで -->
671
+</article>
672
+</section>
673
+</div>
674
+
675
+<script type="text/javascript">
676
+include("http://www.town.kitagata.gifu.jp/kirari/third/learning_consultation_service_life/footer.html");
677
+</script>
678
+
679
+</div>
680
+EOF
681
+print "</body></html>\n";
682
+	exit;
683
+}

+ 1083
- 0
cgi-bin/mail/webform_library.cgi
文件差異過大導致無法顯示
查看文件


+ 1083
- 0
cgi-bin/mail/webform_lifelong_learning.cgi
文件差異過大導致無法顯示
查看文件


+ 1083
- 0
cgi-bin/mail/webform_parliament.cgi
文件差異過大導致無法顯示
查看文件


+ 1083
- 0
cgi-bin/mail/webform_residents.cgi
文件差異過大導致無法顯示
查看文件


+ 1084
- 0
cgi-bin/mail/webform_storage.cgi
文件差異過大導致無法顯示
查看文件


+ 1083
- 0
cgi-bin/mail/webform_tax.cgi
文件差異過大導致無法顯示
查看文件


+ 1084
- 0
cgi-bin/mail/webform_urban.cgi
文件差異過大導致無法顯示
查看文件


+ 1084
- 0
cgi-bin/mail/webform_water.cgi
文件差異過大導致無法顯示
查看文件


+ 1084
- 0
cgi-bin/mail/webform_welfare.cgi
文件差異過大導致無法顯示
查看文件


+ 1
- 1
third/business/SME_employment_adjustment_subsidy_project_cost_subsidy.html 查看文件

@@ -178,7 +178,7 @@
178 178
           </div>
179 179
           <span id="template_article_block">
180 180
             補助金の交付対象期間は、下記のとおり国が定める緊急対応期間とします。<br />
181
-            令和2年4月1日~令和2年9月30日<br />
181
+            令和2年4月1日~令和2年12月31日<br />
182 182
           </span>
183 183
         </article>
184 184
 

Loading…
取消
儲存