8 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
if( $in{'previous'} == 2 ) {
$Command = 'previous';
};
if( $in{'anfang'} == 1 ) {
$Command = 'anfang';
};
if( $in{'ende'} == 4 ) {
$Command = 'ende';
};
if( $in{'next'} == 3 ) {
$Command = 'next';
};
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
-----------------------------------------------------
lib.pl
-----------------------------------------------------
sub ReadParse {
if (@_) {
local (*in) = @_;
}
local ($i, $loc, $key, $val);
# Read in text
if ($ENV{'REQUEST_METHOD'} eq "GET") {
$in = $ENV{'QUERY_STRING'};
} elsif ($ENV{'REQUEST_METHOD'} eq "POST") {
for ($i = 0; $i < $ENV{'CONTENT_LENGTH'}; $i++) {
$in .= getc;
}
}
@in = split(/&/,$in);
foreach $i (0 .. $#in) {
# Convert plus's to spaces
$in[$i] =~ s/\+/ /g;
# Convert %XX from hex numbers to alphanumeric
$in[$i] =~ s/%(..)/pack("c",hex($1))/ge;
# Split into key and value.
$loc = index($in[$i],"=");
$key = substr($in[$i],0,$loc);
$val = substr($in[$i],$loc+1);
$in{$key} .= '\0' if (defined($in{$key})); # \0 is the multiple separator
$in{$key} .= $val;
}
return 1; # just for fun
}
-----------------------------------------------------
main.pl
-----------------------------------------------------
&Init; # Initilisierung der Schnittstelle
$ENV{'QUERY_STRING'} =~ s/\~/\=/g;
&ReadParse;
-----------------------------------------------------
form.pl
-----------------------------------------------------
print <<"ANFANG_KNOPF";
<td align="center">
<input NAME="anfang" type="submit" class="go_button_100_2" value="1">
</td>
ANFANG_KNOPF
print <<"PREV_KNOPF";
<td align="center">
<input NAME="previuos" type="submit" class="go_button_100_2" value="2">
</td>
PREV_KNOPF
print <<"NEXT_KNOPF";
<td align="center">
<input NAME="next" type="submit" class="go_button_100_2" value="3">
</td>
NEXT_KNOPF
print <<"ENDE_KNOPF";
<td align="center">
<input NAME="ende" type="submit" class="go_button_100_2" value="4">
</td>
ENDE_KNOPF
8 Einträge, 1 Seite |