Adresse | Beschreibung |
whois.ripe.net | für den Bereich Europa |
whois.intermic.net | für alle anderen Länder |
Modul Name |
Funktion |
Mod_access |
Steuerung der Zugriffe auf Basis von Hostnamen und/oder
IP- Adressen |
Mod_actions |
Zuordnung von CGI- Scripts zu Mime- Typen |
Mod_alias |
Anlegen virtueller Verzeichnisnamen und redirect auf
andere URLs |
Mod_asis |
Auslieferung von Dokumenten ohne automatisch
generierten Header |
mod_auth |
Konfiguration passwortgeschützter Verzeichnisse |
mod_auth_anon
|
Anonymous- Zugang mit E-Mail-Adresse als Passwort |
mod_auth_db
|
Beglaubigung der Benutzer mittels Berkeley-DB-Dateien |
mod_auth_dbm |
Beglaubigung der Benutzer&xnbsp; mittels DBM-Dateien&xnbsp; |
mod_auth_msql
|
Beglaubigung der Benutzer mittels mSQL-Datenbank |
mod_browser |
Browser-spezifische Konfiguration |
mod_cgi |
Ermöglicht Ausführung von CGI-Scripts |
mod_digest |
Beglaubigung der Benutzer mittels MD5 Digest
Authentication |
mod_cern_meta
|
Ermöglicht Verwendung von Cern-Meta-Dateien |
mod_dir |
Erzeugt Verzeichnisindizes, wenn keine Indexdatei
vorhanden |
mod_dld |
Dynamisches Binden von Modulen |
mod_env |
Übergabe von Umgebungsvariablen an CGI-Scripts und
SSI-Dokumente, Setzen beliebiger Variablen in der Server-Konfiguration |
mod_example |
Demonstration und Test der API |
mod_expires |
Hinzufügen eines Verfalldatums an den Header |
mod_headers |
Modifizieren von HTTP-Header |
mod_imap |
Ermöglicht Server-Side Image Maps |
mod_info |
Informationen über Serverinstallation |
mod_log_agent
|
Protokollieren der Information über Typ und Version der
verwendeten Browser |
mod_log_config |
Führen von einer oder mehreren Protokolldatei(en) |
mod_log_referer |
Informationen über Seiten, die auf die eigene URL
verweisen |
mod_mime |
Generieren der MIME-Header abhängig von der Dateiendung
|
mod_negotiatian |
Funktionen, um Type-Maps und MultiViews zu handhaben |
mod_proxy |
Proxy-Server-Funktionen |
mod_rewrite |
Ersetzt und erweitert mao_alias |
mod_status |
Informationen über aktuellen Serverstatus |
mod_userdir |
Einbinden von Benutzerverzeichnissen |
mod_usertrack |
Kontrolle des Benutzerverhaltens mittels Cookies |
mod_include |
Zur Benutzung von Server-Side Includes (SSI) |
Parameter |
Beschreibung |
ServerType standalone |
Legt fest, dass der Server beim Start selbst den mit
Listen definierten Port (Standard ist 80) öffnet und auf Anfragen wartet. |
Listen 80 |
Falls mehrere Schnittstellen bzw. IP-Adressen für den
Rechner vorhanden sind, kann mit Listen festgelegt werden, welche Ports für
welche Adresse abgehört werden sollen. |
User
http Group html |
Nach dem Öffnen des Ports( als root) wechselt Apache zu
der als User und Group angegebenen UID bzw. GID. Die Zuweisung kann entweder
durch Angeben des Namens oder durch # gefolgt von der ID erfolgen. |
ServerAdmin |
Bei Fehlermeldungen wird diese Adresse dem Client
zurückgekiefert. |
ServerName "http://www.[ihr-server.de]/[inhalt]" |
Wird bei Redirects benötigt (wenn man z.B. durch
Eingabe von "http://www.[ihr-server.de]/[inhalt]" auf das Verzeichnisinhalt zugreifen will, erzeugt der Apache einen Redirect
auf "http://www.[ihr-server.de]/[inhalt]".
Ohne ServerName würde der richtige Hostname des Rechners zurückgeliefert. |
ServerRoot /usr/local/httpd |
Sorgt dafür, dass Apache ausgehend von diesem
Verzeichnis die Verzeichnisse für Dokumente, Logfiles und
Konfigurationsdateien sucht. Achtung: Unter Linux liegen diese Verzeichnisse
nicht alle unter /usr/local/httpd, daher müssen sie gegebenenfalls durch vollständige
Dateipfade angegeben werden. |
DocumentRoot /usr/local/httpd/htdocs |
Hier werden die HTML- Seiten abgelegt. (Eigentlich
hätte hier htdocs als Angabe gereicht. Aus Gründen der Übersichtlichkeit kann
hier der vollständige Pfad angegeben werden.) |
AccessConfig /etc/httpd/acccess.conf |
Datei zur Definition der Funktionen und Zugriffsrechte
bestimmter Verzeichnisse. |
ResourceConfig /etc/httpd/srm.conf |
Diese Datei enhält Angaben zur formatierung und zum
Aussehen der automatisch erzeugten Verzeichnisindizes (FancyIndexing) sowie
Angaben zu den einzelnen Dateitypen. |
TypesConfig /etc/httpd/mime.types |
Enthält die Zuweisungen Dateiendung zu MimeTyp. |
PidFile /var/run/httpd.pid |
Datei, in der sich die Prozess ID des Httpd- Daemon
befindet. |
LookFile /var/looks/httpd.look |
Spezifiziert Lock-File |
ErrorLog /var/log/httpd.error |
Datei zur Aufnahme von Fehlermeldungen und sonstigen
Info-Meldungen (mod_log_config) |
ScriptLog /var/log/httpd.script |
Datei zum Debuggen&xnbsp;
von CGI-Scripts (mod_cgi) |
CustomLog /var/log/httpd.access“%h%I%u%t\“%r\“%s%b\“% {Referer}i\“\“%{User-agent}i\““ |
Erzeugt die Datei httpd.access im Combined-Log-Format
(Hostname, Remote Logname, User-ID, Zeit, erste Zeile der Client-Anfrage,
http-Status-code, Grösse der vom Server ausgelieferten Datei (ohne header),
Wert des Referer Headers, Wert des User-Agent Headers) |
Timeout 300 |
Zeitlimit für Client-Anfragen in Sekunden |
Start Server 5 |
Es werden automatisch 5 untergeordnete (Child-)Prozesse
des Apache gestartet. |
MaxClients 350 |
Maximum gleichzeitig laufender Server-Prozesse. |
MaxRequestsPerChild 30 |
Nach 30 Anfragen wird der untergeordnete Prozess
beendet und gegebenenfalls ein neuer gestartet. |
MinSpareServers 5 MaxSpareServers 10 |
Es existieren immer mindestens 5 und höchstens 10
leerlaufende Prozesse. |
KeepAliveOn |
Unterstützung der http/1.1 Persistent Connections.
Dadurch können über eine TCP-Verbindung mehrere Anfragen an den Server
geschickt werden. |
MaxKeepAliveRequests 10 |
Es werden 10 aufeinanderfolgende Anfragen innerhalb
einer Keep-Alive-Verbindung erlaubt. |
KeepAliveTimeout 15 |
Der Server wartet maximal 15 Sekunden auf weitere
Anfragen des Client bei einer Keep-Alive-Verbindung. |
IndentityCheck Off |
Apache soll keinen IDENT-Lookup ausführen. |
Hostname-Lookups
On |
Es sollen DNS-Lookups ausgeführt werden. |
ContestDigest On |
Es wird ein Content-MD5 Header erzeugt und an den
Client zurückgeschickt. |
BrowserMatch
^Mozilla/2 Nokeepalive BrowserMatch
Java/1.0 force-response-1.0 BrowserMatch
JDK/1.0 force-response-1.0 BrowserMatch
“RealPlayer4.0” Force-response-1.0 |
Hiermit wird Apache angewiesen, auf bestimmte Browser
unterschiedlich zu reagieren. |
Parameter |
Beschreibung |
Alias /icons /usr/local/httpd/iconsAlias /cgi-bin
/usr/local/httpd/cgi-bin Alias /images /usr/local/httpd/images |
Aliasname für bestimmte Verzeichnisse. Diese werden
anschliessend behandelt, als ob sie sich unter htdocs befinden würden. |
UserDir public_html
|
Benutzer
können in ihren Home-Verzeichnissen einen Ordner public_html anlegen und so
Seiten veröffentlichen. |
DirectoryIndex index.html
index.htm |
Wird nur ein Verzeichnis angegeben, wird automatisch nach einer Dateiindex.htm
bzw. index.html gesucht und angezeigt. |
IndexOptions
FancyIndexing |
Wird keine
Indexdatei gefunden, wird der Inhalt des Verzeichnisses als Verzeichnisbaum
angezeigt. |
Indexignore .??** ˆ *# *.bak *.BAK
HEADER.*
README.* RCS core |
Diese
Dateien werden nicht durch FancyIndexing angezeigt. |
ReadmeName
README |
Die Datei
README wird nach dem Verzeichnisbaum angezeigt (also vor <body ). |
HeaderName Header |
Die Date
Header wird direkt nach dem <body-Tag in dem Verzeichnisindex
eingefügt. |
AccessFileName
.htaccess |
Jedes
Verzeichnis kann eine Datei .htaccess enthalten, mit der (falls erlaubt)
der Inhalt von access.conf überschrieben werden kann. |
DefaultType
text/plain |
Dateien
ohne Endung werden wie Text Files behandelt. |
AddType text/html shtml |
Den
Dateien mit der Endung shtml wird der Mime-Type text/html zugeordnet. |
AddHandler
server-parsed shtml AddHandler cgi-script cgi AddHandler
type-map ver |
Weist
Dateien mit bestimmten Endungen Handler zu. |
AddIcon (SRC,/icons/c.gif) .c.h AddIcon (SRC,/icons/p.gif) .pl .py AddIcon (FOR./icons/f.gif) .for AddIcon (UUE,/icons/uuencoded.gif)
.uu AddIcon (SRC,/icons/script.gif)
.conf.config .skel .cf .mc .in .ksh Makefile AddIcon (COR,/icons/bomb.gif) core AddIcon (PAT,/icons/patch.gif)
.patch AddIcon
(TXT,/icons/hand.right.gif) README AddIcon /CGI,/icons/link.gif) .cgi AddIcon (WRL,/icons/world1.gif)
wrl.gz wrl.Z AddIcon (POS,/icons/ps.gif) ps.gz
ps.Z AddIcon (DVI,/icons/dvi.gif)
dvi.gz dvi.Z AddIcon /icons/back.gif.. AddIcon /icons/folder.gif&xnbsp; ^^DIRECTORY^^ AddIcon /icons/blank.gif ^^BLANKICON^^ |
Für das Fancy
Indexing werden bestimmte Endungen Icons zugewiesen |
AddLanguage
de .de # German AddLanguage
en .en # English |
Angaben für ContentNegotiatian |
LanguagePriority
de en |
Falls Dokument in zwei Sprachversionen vorhanden sind, wird
das deutsche Dokument an den Client gesandt |
Parameter |
Beschreibung |
<Directory
/>Options&xnbsp; None AllowOverride None
Order deny,allow Deny from all </Directoy> |
Im root-Verzeichnis werden Konfigurationsanweisungen in der Datei .htaccess nicht beachtet, und es wird kein Zugriff auf irgendwelche Unterverzeichnisse gestattet. |
<Files~“(\.htaccess|/core|~|#|\.bak|\.BAK)$“>order
deny,allow deny,allow deny from all</Files> |
Der Zugriff auf Dateien mit der Bezeichnung .htaccess, Dateien die sich in einem Verzeichniss core befinden oder ~bzw. # enthalten oder mit .bak bzw. .BAK enden, ist nicht gestattet. |
<Location/>Options
SymLinksfOwnerMatchIncludesNOEXEC order allow,deny allow from all Auth Type
Basic Auth UserFile/etc/httpd/passwd</Location> |
Für/usr/local/htdocs und alle Unterverzeichnisse wird festgelegt, dass symbolische Links verfolgt werden dürfen, wenn sie dem Benutzer (http) gehören, und dass Include Anweisungen ausgeführt werden dürfen (ausser exec). Da die Digest-Beglaubigung von dem meisten Browsern noch nicht unterstützt wird, wird die basis Beglaubigung verwendet. |
<Dierectory/usr/local/httpd/cgo-bin>Options
ExecCGI Order allow, deny Allow from all</Directory> |
Im Verzeichnis cgi-bin können CGI-Scripts ausgeführt werden. |
<Location/intern/server-status>Sethandler
server-status AuthName server-status require user webmaster</Location> |
Es wird zugelassen, dass der Benutzer webmaster sich den aktuellen Server-Status anzeigen lassen kann. |
<Location /intern/server-info>SetHandler server-info AuthName server-info require user webmaster</Location> |
Es wird zugelassen, dass der Benutzer webmaster sich die aktuellen Server Infos anzeigen lassen kann. |
<Location /intern/analyse>AuthName analyse require user webmaster</Location> |
In diesem Verzeichnis liegt die Startseite des Logfile-Analyseprogramms Analog (wird in diesem Kapitel noch näher beschrieben). |
<VirtualHost www.macmillan.com> &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;
ServerAdmin&xnbsp;&xnbsp; webmaster@macmillan.com &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;
DocumentRoot&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; /web2 &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;
ServerName&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; www.macmillan.com &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;
ErrorLog&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;
logs/MacMillan/error_log &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;
TransferLog&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;logs/MacMillan/access_log </VirtualHost> |
<HTML> <HEAD> <TITLE>Passwort
und CGI</TITLE> </HEAD> <BODY> <CENTER> <H1> Zutritt hier nur mit Passwort! </H1> </CENTER> <FORM
ACTION=“passwort.cgi“ METHOD=“POST“> <INPUT
NAME=”passwort” TYPE=PASSWORT SIZE=10>PASSWORT: <INPUT
TYPE=”SUBMIT” VALUE=”Senden”></FORM> </BODY> </HTML> |
If&xnbsp; ($value[0] ne „Passwort“ )&xnbsp; { Print “<BODY><h1>Das Passwort ist leider falsch!</h1> <a href=’datei1.html ` >Neuer Versuch</a>“; } else { print&xnbsp;&xnbsp; ` <BODY> <H+Willkommen auf meinen Seiten</H1>&xnbsp; |
<table> |
#!/usr/bin/perl # makeindex - erstelle Index ueber
alle angegebenen Dateien, tk 11.02.1999 # Time-stamp: <1999-03-02 15:47:54 krausst> $makeall=1;&xnbsp;&xnbsp; # search all
files and make complete index &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; # if 0: only sort
wordlist and make index, dont's anaylze files $debug=0;&xnbsp;&xnbsp;&xnbsp;&xnbsp; # =1 show how much
words per file, =2 show added words, >2 show all $|=1; $configdir = "/home/httpd/bin/"; $entitiesfile = "makeindex.entities"; $stopwordlist = "makeindex.stopwords"; $excludelist =
"makeindex.exclude"; # liegt aber unter $basedir!!! if ($#ARGV<0) { print "Usage: $0 <start-dir>\n"; exit 0; } else { $basedir = $ARGV[0]; } #
$basedir = "/home/httpd/html/"; if ($basedir !~ /\/$/) { $basedir .= "/"; } $indexfile = "global_index.idx"; $filesfile = "global_index.files"; $files=0; $metaweight = 20; $weights{"b"} = 4; $weights{"i"} = 3; $weights{"u"} = 4; $weights{"h[12]"} = 8; $weights{"h[3-6]"} = 6; $weights{"title"} = 6; if ($makeall) { if (open(ENTITIES,$configdir.$entitiesfile)) &xnbsp; { while(<ENTITIES>) &xnbsp;&xnbsp;&xnbsp; { chop; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; ($ent,$code) = split; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; $entity{$ent} =
pack("c",$code); &xnbsp;&xnbsp;&xnbsp; } &xnbsp;&xnbsp;&xnbsp; close(ENTITIES); &xnbsp; } else { print STDERR $0,": Kann
Datei ",$configdir.$entitiesfile." nicht oeffnen.\n"; } &xnbsp; &xnbsp; if ($debug) &xnbsp; { print
"Entities:\n"; &xnbsp;&xnbsp;&xnbsp; for $i (keys(%entity)) {
print "Entity ",$i," ist ",$entity{$i},"\n"; } &xnbsp; } &xnbsp; if
(open(STOPWORDS,$configdir.$stopwordlist)) &xnbsp; { while (<STOPWORDS>) &xnbsp;&xnbsp;&xnbsp; { chop; $stopfor{$_} = 1; } &xnbsp;&xnbsp;&xnbsp; close(STOPWORDS); &xnbsp; } &xnbsp; $numexcl=0; &xnbsp; if
(open(EXCL,$basedir.$excludelist)) &xnbsp; { while (<EXCL>) &xnbsp;&xnbsp;&xnbsp; { chomp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if (! /^\s*$/) { $ExcludePattern[$numexcl++]
= $_; } &xnbsp;&xnbsp;&xnbsp; } &xnbsp;&xnbsp;&xnbsp; close(EXCL); &xnbsp; } &xnbsp; &xnbsp; if
(open(FILESFILE,">".$filesfile)) &xnbsp; { if
(open(IDXFILE,">".$indexfile."_pre")) &xnbsp;&xnbsp;&xnbsp; {
&scandir($basedir,".html\$"); #&xnbsp;&xnbsp;&xnbsp;&xnbsp; { if
(open(FILES,"find ".$basedir." -name \"*.html\"
|")) # &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { while
(<FILES>) # &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;{ chop; # &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;print
"Datei ",$files," ",$_,"&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; ",($debug>0) ? "\n" : "\r"; # &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;$file[$files] = $_; # &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&indiziere_file($files,$file[$files]); # &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;$file[$files] =~ s/$basedir//g; # &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;print FILESFILE
$file[$files],"\n"; # &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;$files++; # &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;} # # hier haengt es sich
irgendwie am Ende des find-Befehls auf (-> find=zombie) # # &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;close(FILES); # &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;} else { print
STDERR $0,": Kann find nicht ausfuehren\n"; } &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; close(IDXFILE); &xnbsp;&xnbsp;&xnbsp; } else { print STDERR $0,": Kann Index
",$indexfile,"_pre nicht oeffnen\n"; } &xnbsp;&xnbsp;&xnbsp; close(FILESFILE); &xnbsp; } else { print STDERR $0,": Kann Dateiliste
",$filesfile," nicht oeffnen\n"; } &xnbsp; print STDERR $0,": ",$files," Dateien
indiziert."; } print "sorting ...\n"; system("sort ".$indexfile."_pre
>".$indexfile."_sort"); print "compacting ...\n"; if (open(IDXSORT,$indexfile."_sort")) { if (open(IDX,">".$indexfile)) &xnbsp; { $n=0; &xnbsp;&xnbsp;&xnbsp; while (<IDXSORT>) &xnbsp;&xnbsp;&xnbsp; { chop; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if (($n%200)==0) { print
$n," ",$_,"&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;
\r"; } &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; $n++; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; ($word,$file,$num,$pri) =
split; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if ($word ne $lastword) {
print IDX $lastword,$idlist,"\n"; $idlist=""; } &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; $lastword = $word; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; $idlist .= "
".$file." ".$pri; &xnbsp;&xnbsp;&xnbsp; } &xnbsp;&xnbsp;&xnbsp; print IDX
$lastword,$idlist,"\n"; &xnbsp;&xnbsp;&xnbsp; close(IDX); &xnbsp; } else { print STDERR $0,": Kann Index
",$indexfile," nicht oeffnen\n"; } &xnbsp; close(IDXSORT); } else { print STDERR $0,":
Kann sortierten Index ",$indexfile,"_sort nicht oeffnen\n"; } exit 0; sub scandir { local ($base,$pattern) = @_; &xnbsp; local (@dir_files,$i,$file,$j); &xnbsp; # print STDERR "* Analysiere Verzeichnis $base.\n"; &xnbsp; if ($base !~ /\/$/) { $base .= "/"; } &xnbsp; if (opendir(ACTDIR,$base)) &xnbsp; { @dir_files =
readdir(ACTDIR); &xnbsp;&xnbsp;&xnbsp; closedir(ACTDIR); &xnbsp;&xnbsp;&xnbsp; for ($i=0;
$i<=$#dir_files; $i++) &xnbsp;&xnbsp;&xnbsp; { $file =
$base.$dir_files[$i]; &xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;for ($j=0; $j<$numexcl; $j++) { if ($file =~
/$ExcludePattern[$j]/) { last; } } &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if ($j != $numexcl) &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { print "Datei/Verzeichnis ",$file,"
uebersprungen (exclude $j=",$ExcludePattern[$j],")\n"; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; } elsif ($dir_files[$i] !~ /^\.+$/ && -d $file) # dir-entry is
subdir -> recurse &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { &scandir($file,$pattern); &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; } elsif (-f $file &&
$dir_files[$i] =~ /$pattern/) &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { print "Datei ",$files,"
",$file,"&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;
",($debug>0) ? "\n" : "\r"; &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &indiziere_file($files,$file); &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; $file =~ s/$basedir//g; &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; print FILESFILE $file,"\n"; &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; $files++; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; } &xnbsp;&xnbsp;&xnbsp; } &xnbsp; } else { print STDERR $0,": Kann Verzeichnis $base nicht
oeffnen\n"; } &xnbsp; # print STDERR "* zurueck von Verzeichnis $base.\n"; } sub replace_entities { local ($text) = @_; &xnbsp; local ($done); &xnbsp; $done=""; &xnbsp; while ($text =~
/\&([a-z]+)\;/i) { $done .= $`.$entity{$1}; $text = $'; } &xnbsp; $done .= $text; &xnbsp; return($done); } sub indiziere_file { local ($num,$file) = @_; &xnbsp; local
($i,$rest,$pre,$tag,$endtag); &xnbsp; $weight=1; &xnbsp; if (open(FILE,$file)) &xnbsp; { while (<FILE>) &xnbsp;&xnbsp;&xnbsp; { chomp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; $_ =
&replace_entities($_); &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; while
(/\<(\/?)([0-9a-z]+)\s*/i) &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { $pre=$`; $endtag=$1; $tag=$2; $rest = $'; &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if ($debug>2) {
print "Tag found: ($pre)<($endtag)($tag) ..."; } &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if ($pre !~ /^\s*$/) { &addwords($pre,$weight); } &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; while ($rest !~ /\>/) # read until end of tag &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { $_=<FILE>; chop; $rest .= " ".$_; } &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if ($rest =~ />/) &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { $tagcontent = $`; $rest = $'; } &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if ($debug>2) { print "...
($tagcontent)>\n"; } &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if ($tag =~ /meta/i) &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { while ($tagcontent =~
/content=\"([^\"]+)\"/i || $tagcontent =~ /content=(\S+)/i) &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;{ $pre = $1; &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;$tagcontent =
$'; &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;if ($pre !~
/^\s*$/) { &addwords($pre,$metaweight); } &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;} &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; } else # change weight, if relevant tag &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { for $i (keys(%weights)) &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;{ if ($tag =~
/^$i$/i) &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;{ if ($endtag eq
"/") { $weight -= $weights{$i}; } &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; else { $weight += $weights{$i}; } &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;} &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;} &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;if ($weight<1)
{ $weight=1; } &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; } &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;$_ = $rest; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; } &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if ($_ !~ /^\s*$/) {
&addwords($_,$weight); } &xnbsp;&xnbsp;&xnbsp; } &xnbsp;&xnbsp;&xnbsp; close(FILE); &xnbsp;&xnbsp;&xnbsp; &writewords($num); &xnbsp; } else { print STDERR $0,": Kann Datei
",$file," nicht oeffnen.\n"; } } sub addwords { local ($from,$weight) = @_; &xnbsp; local ($word,$n); &xnbsp; if ($debug>1) { print
"Add $weight ($from)\n"; } &xnbsp; while ($from =~
/([0-9a-zA-Z\xc0-\xff]+)/) &xnbsp; { $word = $1; $from = $'; &xnbsp;&xnbsp;&xnbsp; if (length($word)>1) &xnbsp;&xnbsp;&xnbsp; { # lowercase words with
all special characters &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; $n=0; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; while ($word =~
/([A-Z\xc0-\xde])/) { $word =
$`.pack("c",unpack("c",$1)+32).$'; $n++;} &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if (! $stopfor{$word}) &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { $words{$word} +=
$weight + ($n>0?1:($n>2?2:0)); &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; $numwords{$word}++; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if ($debug>1) {
print "&xnbsp; $word $weight
",($n>0 ? ($n>1 ? 3 : 1) : 0),"\n"; } &xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;} &xnbsp;&xnbsp;&xnbsp; } &xnbsp; } } sub writewords { local ($num) = @_; &xnbsp; local ($i,$numw,$n); &xnbsp; $numw=0; $n=0; &xnbsp; for $i (keys(%numwords)) {
$numw+=$numwords{$i}; $n++; } &xnbsp; if ($debug) { print "&xnbsp;&xnbsp;&xnbsp;&xnbsp; ",$numw," Worte, davon ",$n,"
verschieden.\n"; } &xnbsp; for $i (sort(keys(%words))) &xnbsp; { print IDXFILE $i,"
",$num," ",$numwords{$i},"
",$words{$i},"\n"; &xnbsp;&xnbsp;&xnbsp; delete $numwords{$i}; &xnbsp;&xnbsp;&xnbsp; delete $words{$i}; &xnbsp; } } |
szlig 223 auml&xnbsp; 228 ouml&xnbsp; 246 uuml&xnbsp; 252 Auml&xnbsp; 196 Ouml&xnbsp; 214 Uuml&xnbsp; 220 nbsp&xnbsp;&xnbsp; 32 |
ab aber abk alle allem allen aller alles als also am an auch auf aus bei beim bis bzw ca da dabei damit dann das daß dem den denen der deren des dessen die dies diese diesem diesen dieser dieses durch ein eine einen einer eines es etc für hat hier im in inkl ist je kann kein keine keinem keinen keiner keines können lassen mehr mehrere mehreren mehrerer meist mit muß mußte mußten nach nicht nur oder sein sich sie sind so sowie that the then there these this um und up vom von vor was wenn werden wie will zu zum zur über |
<HTML> &xnbsp; <HEAD> &xnbsp;&xnbsp;&xnbsp; <TITLE>INTEREST
VERLAG</TITLE> &xnbsp; </HEAD> &xnbsp; <BODY> &xnbsp; <FORM METHOD=POST
ACTION="cgi/suche"> &xnbsp; <INPUT TYPE=text NAME="suche" SIZE=15>Suche im Angebot &xnbsp; </FORM> &xnbsp; </BODY> </HTML> |
#!/usr/bin/perl # suche
created 11 Feb 99 14:20:10 by thk # Time-stamp: <1999-02-12 13:02:02 krausst> $debug=0; $basedir =
"/home/httpd/html/"; $indexfile
= "global_index.idx"; $filesfile
= "global_index.files"; $urlbase =
"http://www.interest.de/"; $maxshow=50; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
= localtime(time); if
($year<1900) { $year += 1900; } $nowdate
= sprintf("%02d.%02d.%d",$mday,$mon+1,$year); $now =
sprintf("%04d%02d%02d.%02d%02d%02d",$year,$mon+1,$mday,$hour,$min,$sec); if
($#ARGV>-1) { $HTMLArg{"suche"}=$ARGV[0]; } else {
&parseArgs(); } print
<<EOT; Content-Type:
text/html <HTML><HEAD><TITLE>Suchergebnis</TITLE></HEAD><BODY> <H2>Suchergebnis</H2> Ihre Suche nach <I>$HTMLArg{"suche"}</I> hat folgendes Ergebnis geliefert: <P> <TABLE> <TR><TD
width=10%><I>Rel.</I></TD><TD
width=90%><I>Datei</I></TD></TR> EOT @searchfor
= @searchall = split(/,?\s+/,$HTMLArg{"suche"}); # remove
leading +'s for
($i=0; $i<=$#searchfor; $i++) { $searchfor[$i] =~ s/^\+//g; } # for
($i=0; $i<=$#searchfor; $i++) { print STDERR "Suchstring $i
($searchfor[$i])\n"; } if
(open(IDX,$basedir.$indexfile)) { while
(<IDX>) &xnbsp; { chop; &xnbsp;&xnbsp;&xnbsp; ($key,$loc) = split(/ +/,$_,2); &xnbsp;&xnbsp;&xnbsp; for ($i=0; $i<=$#searchfor; $i++) &xnbsp;&xnbsp;&xnbsp; { if ($key =~ /$searchfor[$i]/i) &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { @pairs = split(/ +/,$loc); &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if ($searchall[$i] =~ /^\+/) # aha! der muss unbedingt dabei sein. &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { $pri=100; # dann heben wir mal das weight deutlich an &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; } else { $pri=0; } &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if ($key =~ /^$searchfor[$i]$/i) # aha, genau der Begriff -> weight anheben &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { $pri+=10; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; } elsif ($key =~ /^$searchfor[$i]/i) # naja, immerhin der Anfang ... &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { $pri+=3; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; } elsif ($key =~ /$searchfor[$i]$/i) # ... oder das Ende &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { $pri+=3; } &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; for ($j=0; $j<=$#pairs; $j+=2) &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { $weight{$pairs[$j]} +=
$pairs[$j+1]+$pri; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;
$foundkeys{$pairs[$j]} .= $key." "; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;
$treffer[$i]++; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;
# print $key," ",$pairs[$j],"\n"; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; } &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; } &xnbsp;&xnbsp;&xnbsp; } &xnbsp; } &xnbsp; close(IDX); &xnbsp; # jetzt stehen in $weight{$fileid} mal alle Gewichte drin. &xnbsp; # die Ausgabe soll aber umgekehrt nach weight sortiert erfolgen &xnbsp; $numfiles = 0; &xnbsp; for $i (keys(%weight)) &xnbsp; { $foundfiles{$weight{$i}} .= $i."
"; &xnbsp;&xnbsp;&xnbsp; # print $i,"
",$weight{$i},"\n"; &xnbsp;&xnbsp;&xnbsp; delete $weight{$i}; &xnbsp;&xnbsp;&xnbsp; $numfiles++; &xnbsp; } &xnbsp; # zur Ausgabe brauchen wir jetzt noch die richtigen Dateinamen &xnbsp; if (open(FILES,$basedir.$filesfile)) &xnbsp; { $files=0; &xnbsp;&xnbsp;&xnbsp; while (<FILES>) &xnbsp;&xnbsp;&xnbsp; { chop; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; $file[$files++]=$_; &xnbsp;&xnbsp;&xnbsp; } &xnbsp;&xnbsp;&xnbsp; close(FILES); &xnbsp;&xnbsp;&xnbsp; # so, jetzt koennen wir die Ausgabe starten: &xnbsp;&xnbsp;&xnbsp; $numshow=0; &xnbsp;&xnbsp;&xnbsp; for $w (sort { $b <=> $a }
keys(%foundfiles)) &xnbsp;&xnbsp;&xnbsp; { # print "Foundfiles(weight $w):
",$foundfiles{$w},"\n"; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; @fids = split(/ +/,$foundfiles{$w}); &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; for ($i=0; $i<=$#fids; $i++) &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; {
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,$atime,$mtime,$ctime,$blksize,$blocks) &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp; = stat($basedir.$file[$fids[$i]]); &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
= localtime($mtime); &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; printf "<TR><TD
valign=top>%s</TD><TD><A
HREF=\"%s%s\">%s</A> <I>(%02d.%02d.%d, %d
Bytes)</I><BR><FONT size=-1>%s</FONT></TD></TR>\n",$w,
# $fids[$i], &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;
$urlbase,$file[$fids[$i]],$file[$fids[$i]],$mday,$mon+1,$year+1900,$size,$foundkeys{$fids[$i]}; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; $numshow++; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if ($numshow > $maxshow) { last;
} &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; } &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if ($numshow > $maxshow) { last; } &xnbsp;&xnbsp;&xnbsp; } &xnbsp; } else { print "Kann Dateinamendatei nicht oeffnen.\n"; } } else { print "Kann Indexdatei nicht oeffnen.\n"; } print
"</TABLE>"; print
"$numfiles Treffer",($numfiles>$maxshow? ", $maxshow
angezeigt":""),":<BR>"; print
"<TABLE><TR><TD><I>Begriff</I></TD><TD><I>Treffer</I></TD></TR>\n"; for
($i=0; $i<=$#searchall; $i++) { print
"<TR><TD>",$searchall[$i],"</TD><TD>",$treffer[$i],"</TD></TR>\n";
} print
"</TABLE>\n"; exit 0; sub
parseArgs { &xnbsp; $user = $ENV{"REMOTE_USER"}; &xnbsp; if ($ENV{"PATH_INFO"} ne
"") { ($dummy,$Extra) = split(/\//,$ENV{"PATH_INFO"}); } &xnbsp; else { $Extra=""; } &xnbsp; if ($debug) { printf "parse
Args<BR>\n"; } &xnbsp;&xnbsp;&xnbsp; # parse args from stdin-form
(/cgi-bin/htdb/<database-id> only called by form!!!) &xnbsp;&xnbsp;&xnbsp; $_ = <STDIN>; # chop; beim Apache scheinbar nicht??? &xnbsp;&xnbsp;&xnbsp; @HTMLArgs=split("&"); &xnbsp;&xnbsp;&xnbsp; for ($i=0; $i<=$#HTMLArgs; $i++) &xnbsp;&xnbsp;&xnbsp; { $HTMLArgs[$i] =~ s/\+/ /g; &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; while
(($pos=index($HTMLArgs[$i],"%"))>-1) &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { substr($HTMLArgs[$i],$pos,3) = &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; &xnbsp;&xnbsp;&xnbsp; sprintf("%c",hex(substr($HTMLArgs[$i],$pos+1,2))); &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; } &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if ($debug) { printf "Feld %2d:
'%s'<BR>\n",$i,$HTMLArgs[$i]; } &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; if ($HTMLArgs[$i] =~
/^([A-Za-z0-9]+)=/) &xnbsp;&xnbsp;&xnbsp;&xnbsp;&xnbsp; { if ($HTMLArg{$1} ne "") {
$HTMLArg{$1} .= "\n".$'; } else { $HTMLArg{$1} = $'; } } &xnbsp;&xnbsp;&xnbsp; } &xnbsp;&xnbsp;&xnbsp; if ($debug) { for $i
(sort(keys(%HTMLArg))) { printf
"Arg(%s)=(%s)<BR>\n",$i,$HTMLArg{$i}; } } } |