安装了但打开127.0.0.1/index.php 看到的是
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<title>iPhone PHPBox</title>
<meta name="viewport" content="width=320; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;">
<link rel="stylesheet" type="text/css" href="css/list.css" />
<style type="text/css">
body > ul > li {
font-size: 14px;
}
li .icon {
display: block;
position: absolute;
margin: 0;
left: 6px;
top: 7px;
text-align: center;
font-size: 110%;
letter-spacing: -0.07em;
color: #93883F;
font-weight: bold;
text-decoration: none;
width: 36px;
height: 30px;
padding: 7px 0 0 0;
}
li .desc {
display: block;
position: absolute;
margin: 0;
left: 54px;
top: 20px;
text-align: center;
font-size: 110%;
font-weight: bold;
text-decoration: none;
height: 30px;
padding: 7px 0 0 0;
background: none;
}
h2 {
margin: 10px;
color: slateblue;
}
p {
margin: 10px;
}
h2 {
margin: 8px;
}
h2.error {
color: #f00;
}
</style>
</head>
<?php
$d='/'; // the current folder, ex: /pdf/2008/
if(isset($_GET['d']))
{
$d=urldecode($_GET['d']);
}
if(!isset($rootdir))
{
$rootdir=Getcwd().$d;
}
$findme = '/';
$pos = strrpos(substr($d,0,strlen($d)-1), $findme);
$updir = substr($d, 0, $pos+1);
$curfolder = 'localhost';
if($d != '/'){
$curfolder = substr($d, $pos+1, strlen($d)-$pos-2);
}
?>
<body orient="landscape">
<div class="toolbar">
<h1 id="pageTitle"><?php echo($curfolder); ?></h1>
<?php if($d != '/'): ?>
<a style="display: inline;" id="backButton" class="button" href="<?php echo($_SERVER['PHP_SELF']."?d=".urlencode($updir)); ?>">返回</a>
<?php endif; ?>
</div>
<ul style="left: 0%;" id="as" title="" selected="true">
<?php
myreaddir($rootdir);
function myreaddir($subdir) //get all file and folders in subdir
{
global $rootdir,$d;
$icons=array("default"=>"default_file.gif","pdf"=>"pdf_file.gif","ppt"=>"ppt_file.gif","doc"=>"doc_file.gif","xls"=>"xls_file.gif","zip"=>"zip_file.gif","rar"=>"rar_file.gif","htm"=>"htm_file.gif","html"=>"html_file.gif","mov"=>"mov_file.gif","mp3"=>"mp3_file.gif","php"=>"php_file.gif","gif"=>"gif_file.gif","png"=>"png_file.gif","jpg"=>"jpg_file.gif","txt"=>"txt_file.gif");
@chdir($subdir) or die ("error:could not change to this directory!");
$dirobject=dir($subdir);
$x=0;$y=0;$i=0;$j=0;
while ($file=$dirobject->read())
{
if(is_dir($file)) //if is folder
{
if($file=="." or $file=="..") //"."&".."
{
// echo "";
continue;
}
$dir_array[$x++] = $file;
continue;
}
$file_array[$i++] = $file;
}
if($i>0) sort($file_array);
if($x>0) sort($dir_array);
while($x>0)
{
echo "<li><a class=\"icon\"><img alt=\"Icon\" src=\"css/small_folder_icon.gif\"></a>";
echo "<a class=\"folder\" href=\"".$_SERVER['PHP_SELF']."?d=".urlencode($d.$dir_array[$y].'/')."\">".substr_for_url($dir_array[$y],42)."</a>";
echo "<a class=\"desc\">".date("Y-m-d", filemtime($dir_array[$y]))."</a></li>";
$x--;$y++;
}
while($i>0)
{
$file_type=strtolower(substr(strrchr($file_array[$j],"."),1));
$file_href="http://".$_SERVER['HTTP_HOST'].$d.$file_array[$j];
if(!isset($icons[$file_type])) $file_type="default";
echo "<li><a class=\"icon\"><img alt=\"Icon\" src=\"css/".$icons[$file_type]."\"></a>";
echo "<a class=\"file\" href=\"".$file_href."\">".substr_for_url(urldecode($file_array[$j]),42)."</a>";
echo "<a class=\"desc\">".(number_format(filesize($file_array[$j])/1024,2))."KB ".date("Y-m-d", filemtime($file_array[$j]))."</a></li>";
$i--;$j++;
}
return;
}
function substr_for_url($str,$len=null)
{
$totlelength = strlen($str);
if ($len == null) $len = $totlelength;
if ($len ==0) return "";
if ($len >= $totlelength ) return $str;
if ($len < $totlelength) $shorten = true;
$subit=substr($str,0,$len);
if($shorten) $subit = $subit.'...';
return $subit;
}
?>
</ul>
</body></html>
是不是我的php还没有设施好啊? 谢谢