Thread simpler Vergleich: vergleich vergleicht nicht (7 answers)
Opened by Gast at 2004-01-15 11:56

jamaica-man
 2004-01-15 12:47
#922 #922
User since
2004-01-15
2 Artikel
BenutzerIn
[default_avatar]
Ok, ich versuchs mal:

Code: (dl )
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


Aso, main.pl includet die lib.pl
und die main.pl wir dvon der seite form.pl aufgerufen.
Der problemcode steht in der main.pl

So, das ist das was ich habe.
mfg Martin\n\n

<!--EDIT|jamaica-man|1074163823-->

View full thread simpler Vergleich: vergleich vergleicht nicht