Leser: 1
|< 1 2 >| | 19 Einträge, 2 Seiten |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!C:\Perl\bin\perl.exe
print "Content-type: text/html\n\n";
print "<html><h1>Hello</h1></html>\n";
print "<head>\n";
print "<title>TEST</title>\n";
print "</head>\n";
&getmychoices;
print "<body link=\"\#000000\" bgcolor=\"\#F0F2FF\">\n";
print "<table border=\"1\">\n";
print "<tr>\n";
print "<td width=\"80\" height=\"1\">Select Stadt</td>\n";
print "<td font face=\"arial\" size=\"2\"><select name=\"stadt\" size=\"1\">\n";
for(getchoices("stadt")) {
print "<option value=\"$_\">$_</option>\n";
}
print "</select></font></td></tr>\n";
print "<tr>\n";
print "<td width=\"80\" height=\"1\">Select Daten</td>\n";
print "<td font face=\"arial\" size=\"2\"><select name=\"daten\" size=\"1\">\n";
for(getchoices("daten"))
{
@typ_split = split(/\|\|/,$_);
print "<option value=\"$_\">@typ_split[0]</option>\n";
}
print "</select></font></td></tr>\n";
print "</table>\n";
print "</body>\n";
print "</html>\n";
sub getchoices {
@back = "";
pop(@back);
$on = 0;
for(@mychoices) {
if ($_ =~ /<\#$_[0]>/) { $on = 0; }
if ($on == 1) { push(@back,$_); }
if ($_ =~ /<$_[0]>/) { $on = 1; }
}
for (@back) {
$_ =~ s/[\n]//;
}
return @back;
}
sub getmychoices {
$self_name = substr($0,rindex($0,"\\")+1);
$self_path = substr($0,0,rindex($0,"\\")+1);
chdir("/data");
open(ALT,"<choices.txt");
while(<ALT>) {
push(@choices,$_);
}
close(ALT);
$on = 0;
for(@choices) {
if ($_ =~ /<!!>end choices.+$self_name<!!>/) {$on = 0;}
if ($on == 1) {
push(@mychoices,$_);
}
if ($_ =~ /<!!>start choices.+$self_name<!!>/) {$on = 1;}
}
}
1
2
3
4
unless (open(ALT,"<choices.txt")) {
print "Konnte Datei 'choices.txt' nicht oeffnen: $!\n";
exit 0;
}
1
2
3
4
5
6
use FindBin; # $FindBin::Bin enthaelt den pfad zum Script
my $file = "$FindBin::Bin/../data/choices.txt"; # oder was auch immer
unless (open (ALT, $file)) {
print "Fehler: konnte Datei '$file' nicht oeffnen: $!\n";
exit 0;
}
|< 1 2 >| | 19 Einträge, 2 Seiten |