9 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
<form action="../cgi-bin/lit_search1.pl" method="post">
<select multiple="multiple" name="auswahl" size="4">
<option selected="selected"
value="./literatur/Literatur_Notizbuecher.txt|in Notizbüchern (Heft 1-67) veröffentlicht (Zusammenstellung: Spreter, R. 1996, Moes, G. 2005)">Notizbücher</option>
<option
value="./literatur/Literatur_Mitglieder.txt|Veröffentlichungen von Mitgliedern ausserhalb der Notizbücher (Zusammenstellung: Theiling, C., Moes, G. 2005)">Veröff.
v.
Mitgliedern </option>
<option
value="./literatur/Literatur_Huelbusch.txt|Hülbusch (Zusammenstellung Böse-Vetter, H. u. Sauerwein, B. 1996: ergänzt Moes, G. 2005)">Hülbusch</option>
<option
value="./literatur/Literatur_Baeume.txt|Literatur zur Baumpflege (Zusammenstellung: Moes, G. 2002)">Bäume</option>
</select>
<input name="text" size="20" type="text"><br>
<input value="OK" type="submit">
<select name="boolean">
<option>und </option>
<option>oder </option>
</select>
</form>
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
#!/usr/bin/perl -w
# !C:\xampp\xampp\perl\bin\perl.exe
# ###################################################################
#
# lit_search1.pl
#
# Moes G. 2005
#
# ###################################################################
# Change here the names of the needed files
# The name of the results template
$tplfile="../httpdocs/results1.htm";
# Path to file containing all urls
# $url_file="index_1.txt";
# ####################################################################
# Get the data from the form
# &parse_form;
use CGI;
my $query = new CGI; # neues CGI-Objekt erzeugen
$SEARCH = $query->param('text');
@TEXTS = split(/\s+/, $SEARCH);
@ALLURLS = $query->param('auswahl');
$BOOL = $query->param('boolean');
#@texts = split(/\s+/, $FORM{'text'});
# $text = $FORM{'text'};
foreach $text (@TEXTS) {
if ($text eq "")
{
# print $cgi->start_html( -title => 'Literatursuche');
print "Content-type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print "<title>Literatursuche</title>\n";
print "</head>\n";
print "<body>\n";
print "<script language=\"JavaScript\">\n";
print "{\n";
print "alert(\"Kein Suchtext angegeben\");\n";
print "history.back();\n";
print "}\n";
print "</script>\n";
print "</body></html>";
exit;
}
}
# Read the template
if (open(FILE,"$tplfile"))
{
@TEMPLATE = <FILE>;
close(FILE);
}
else
{
&error_open;
}
# Locates ##LOOP-START## and ##LOOP-END## in the template
$loopstart = 0;
$loopend = 0;
$tempsize=@TEMPLATE;
for($n=0; $n<$tempsize; $n++) {
$line=$TEMPLATE[$n];
if($line =~ /LOOP-STARTS/i) {
$loopstart=$n; }
if($line =~ /LOOP-ENDS/i) {
$loopend=$n; }
}
# print the top of the page
print "Content-type: text/html\n\n";
for($n=0; $n<$loopstart; $n++) {
$line=$TEMPLATE[$n];
# $line =~ s/##TEXT##/$text/gi; # Use of uninitialized value in substitution (s///),
print $line; }
# flags definition
$flag_any = 0;
$flag_page = 0;
$counter = 0;
# Read urls from index file
if (open(FILE,"$url_file")) # Use of uninitialized value in join or string
{
@ALLURLS = <FILE>;
close(FILE);
}
else {
@ALLURLS = $query->param('auswahl');
# @ALLURLS = $FORM{'auswahl'};
}
# {
# &error_open;
# }
# Loops through all urls
for($n=0; $n<@ALLURLS; $n++) {
$flag_page=0;
# split between the URL and the page description
@PARTS = split(/\|/, $ALLURLS[$n]);
if (open(CONTENT_FILE,"$PARTS[0]"))
{
@CONTENT = <CONTENT_FILE>;
$all = @CONTENT;
close(CONTENT_FILE);
for($m=0; $m<@CONTENT && $flag_page < 10000; $m++) {
$line=$CONTENT[$m];
# Remove html tags from $line
$line =~ s/<(.*?)>/\.\.\./g;
$i=1;
if ($BOOL eq 'oder'){
#if ($FORM{'boolean'} eq 'oder'){
foreach $text (@TEXTS) {
# $i;
if($line =~ /$text/){
# Highligt the text found
$line=~ s/$text/<b>$text<\/b>/g;
&result;
}
$i = $i++;
}
}
elsif ($BOOL eq 'und'){
#elsif ($FORM{'boolean'} eq 'und'){
if($line =~ /$TEXTS[0]/) {
if ($line =~ /$TEXTS[1]/) { # Use of uninitialized value in join or string
if ($line =~ /$TEXTS[2]/) { # Use of uninitialized value in join or string
if ($line =~ /$TEXTS[3]/) {# Use of uninitialized value in join or string
if ($line =~ /$TEXTS[4]/) {# Use of uninitialized value in join or string
# Highligt the text found
foreach $text (@TEXTS) {
# $i;
$line=~ s/$text/<b>$text<\/b>/g;
}
&result;
$i = $i++;
}
}
}
}
}
}
}
}
else
{
&error_open;
}
}
# Prints the rest of the page
if ($flag_any == 0)
{
print "<div align=\"center\">";
print "<center>";
print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"4\" width=\"70%\">";
print "<tr>";
print "<td width=\"100%\"><font color=\"#000080\" face=\"Arial\" size=\"2\">Kein passender Eintrag gefunden.</font></td>";
print "<\/tr>";
print "<\/table>";
print "<\/center>";
print "<\/div>";
}
for($n=$loopend; $n<$tempsize; $n++) {
$line=$TEMPLATE[$n];
$line =~ s/##QUERY##/$query/gi;
print $line; }
exit;
sub parse_form {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
if (length($buffer) < 5) {
$buffer = $ENV{QUERY_STRING};
}
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
if($name eq "category") {
$value =~ s/ /_/g;
$value="#".lc($value);
$value=$FORM{'category'}.$value;
}
$FORM{$name} = $value;
}
}
sub error_open
{
print "Content-type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print "<title>Fehler!</title>\n";
print "</head>\n";
print "<body>\n";
print "<h1>";
print "Die Datei $filename konnte nicht geöffnet werden oder wurde nicht gefunden.";
print "</h1><br>";
print "</body></html>";
exit;
}
sub result {
$counter = $counter + 1;
# Prints this record looping throug the template
for($tpline=$loopstart; $tpline<$loopend && $flag_page == 0; $tpline++)
{
$linet=$TEMPLATE[$tpline];
$linet =~ s/##DESCRIPTION##/$PARTS[1]/gi;
# $linet =~ s/##URL##/$PARTS[0]/gi;
# $linet =~ s/##NUM##/$i/gi;
$linet=~ s/##ALL##/$all /gi;
print $linet;
}
print "<td style = \"text-indent:-70pt; padding-left:70pt;\">";
print "<font face=\"Arial\" size=\"2\">";
print $line;
print"<br>";
print "<\/font>";
print "<\/td>";
print "<\/tr>";
$flag_page = $flag_page+1;
if ($flag_page == 2) {$counter--;}
$flag_any = 1;
}
1
2
3
4
5
6
7
8
9
10
11
12
<table border="0" cellpadding="0" cellspacing="4">
<!-- LOOP-STARTS --> <tbody>
<tr>
<td><br>
<p style="color: blue;">##DESCRIPTION##
(in
##ALL## Datensätzen gefunden:)</p>
</td>
</tr>
<!-- LOOP-ENDS -->
</tbody>
</table>
[Thu Jul 14 23:39:20 2005] [error] [client 84.138.XXX.XX] (70007)The timeout specified has expired: ap_content_length_filter: apr_bucket_read() failed, referer: http://www.freiraumundvegetation.de/bibliographie.htm
9 Einträge, 1 Seite |