Hallo, ich habe ein Programm installiert welches mein Rechner als http-server einrichtet (KFWS-Server) dieses enthält ein Script welches im Root die Ordner und Dateien auflistet, ich denke es ist PHP, aber wenn ich was einfüge kommt im IE ein Fehler. Hier mal das Script:
PHP:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<?kfl
/*
``The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF
ANY KIND, either express or implied. See the License for the specificlanguage governing rights and
limitations under the License.
The Original Code is KF Web Server Admin Interface.
The Initial Developer of the Original Code is KeyFocus Ltd. (http://www.keyfocus.net) Portions created by
KeyFocus Ltd. are Copyright (C) 2002-2003 KeyFocus Ltd. All Rights Reserved.
Contributor(s): ______________________________________.
[NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code.
You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.]
*/
$reqpath = envvar("PATH_INFO");
$title = $reqpath;
?>
<HTML><HEAD><TITLE><?kfl echo($title);?></TITLE>
<META NAME="Generator" CONTENT="KF Web Server">
<STYLE TYPE="text/css">
<!--
TD.filedesc {font: xx-small;}
TD.coltitle {font: xx-small;font-weight: bold;}
H1 {color: #330099; font-weight: bold; font: large;margin-bottom: 2pt;}
-->
</STYLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#000080" VLINK="#000080" ALINK="#FF0000" LEFTMARGIN="3" RIGHTMARGIN="0" TOPMARGIN="0" marginwidth="0" marginheight="0">
<BASEFONT FACE="Verdana,Arial,Helvetica,sans-serif" SIZE=1>
<!-- Copyright © 2002 KeyFocus Ltd. All rights reserved-->
<?kfl
### set the following variables to control the format of the directory index
$showdirectories = true;
$showparentdirectory = true;
$showfilesizes = true;
$showfiledates = true;
$showfiletypes = true;
echo("<H1>",$title,"</H1><HR>\n");
outputindex();
function outputindex()
{
global $showdirectories, $showparentdirectory,$showfilesizes,$showfiledates,$showfiletypes, $reqpath;
### Set the sort order by changing the variable below
# 1 -> Sort by name
# 2 -> Sort by extension
# 3 -> Sort by size
# 4 -> Sort by date
# make the value negative to make a reverse sort
# e.g. -3 -> Sort by size, largest first
$sortby = 1;
$dirpath = envvar("ORIG_PATH_TRANSLATED");
if (isblank($dirpath))
{
$showparentdirectory = false;
$numfiles = 0;
}
else
{
if (envvar("PATH_INFO") == "/")
$showparentdirectory = false;
$numfiles = directorylistsorted($dirpath,$wildcard,$files,$filesizes,$filedates,$filetypes,$showdirectories,false,$sortby);
}
$s = strlen($reqpath);
if (!isblank($reqpath))
{
if (substr($reqpath,strlen($reqpath) -1,1) != "/")
$reqpath .= "/";
}
// Output the table
echo(|<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="1">|);
$cols = |<COL>|;
$coltitles = |<TD class="coltitle">File Name</TD>|;
if ($showfilesizes) {$coltitles .= |<TD> </TD><TD class="coltitle">Size</TD>|; $cols .= |<COL><COL ALIGN="right">|;}
if ($showfiledates) {$coltitles .= |<TD> </TD><TD class="coltitle">Date</TD>|; $cols .= |<COL><COL>|;}
if ($showfiletypes) {$coltitles .= |<TD> </TD><TD class="coltitle">Type</TD>|; $cols .= |<COL><COL>|;}
echo($cols,"\n\t<TR>",$coltitles,"</TR>\n\t");
if ($showparentdirectory)
filerow($reqpath . "../","../","","","Parent Directory");
for ($i = 0 to $numfiles -1)
{
if ($filetypes[$i] == 1)
$ft = "Directory";
else
$ft = mimetype($files[$i]);
if (!isblank($ft))
filerow($reqpath . urlencode($files[$i]),$files[$i],$filesizes[$i],$filedates[$i],$ft);
}
echo(|</TABLE>|);
}
function filerow($filenameurl,$filename,$filesize,$filedate,$filetype)
{
global $showfilesizes,$showfiledates,$showfiletypes;
echo(|<TR><TD class="filedesc"><A HREF="|,$filenameurl,|">|,$filename,|</A></TD>|);
if ($showfilesizes)
{
if (isblank($filesize)) $filesize = " ";
echo(|<TD> </TD><TD class="filedesc">|,$filesize,|</TD>|);
}
if ($showfiledates)
{
if (isblank($filedate)) $filedate = " ";
echo(|<TD> </TD><TD class="filedesc">|,$filedate,|</TD>|);
}
if ($showfiletypes)
{
if (isblank($filetype)) $filetype = " ";
echo(|<TD> </TD><TD class="filedesc">|,$filetype,|</TD>|);
}
echo("</TR>\n\t");
}
?>
</BODY></HTML>
Hier möchte ich was einfügen
PHP:
<?kfl
$reqpath = envvar("PATH_INFO");
$title = $reqpath;
?>
PHP:
<?kfl
$reqpath = envvar("PATH_INFO");
$regpath = ereg_replace( 'f', 'e', $regpath);
$title = $reqpath;
?>
Dann kommt aber im IE:
Code:
Compilation error: ´parse error´ in C:\Programme\KeyFocus\KFWS\systemscripts\makeindex.wkf on line 20
kann mir jemand sagen ob das php ist und wieso das nicht funktioniert?
Zuletzt bearbeitet: