亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定

我到這一步為什么不能echo出創建的文件?

<?php

require_once 'dir.func.php';

require_once 'file.func.php';

$path="file";//打開名字為“file”的目錄

$info=readDirectory($path);//使用dir.func函數,讀取$path目錄下的內容,并且將讀取到的二維數組內容賦值到$info上。

$act=$_REQUEST['act'];

$filename=$_REQUEST['filename'];

if ($act=="createFile"){

? ? echo $path.'--';

? ? echo $filename;

}


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>

<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>

<link href="css/cikonss.css" rel="stylesheet" type="text/css">

<style>div,ul,li{list-style-type:none;margin:0;padding:0;}</style>

<title>在線文件管理</title>

</head>

<body>

<h1>在線文件管理系統</h1>

<div id="top">

<ul il="nav">

<li><span class="icon icon-small icon-square"><span></span></span></li>

<li><span class="icon icon-small icon-square"><span></span></span></li>

<li></li>

<li></li>

<li></li>

</ul>

</div>

<table width="100%" cellsapcing="0" border="1" cellpadding="5" bgcolor="#ABCDEF" algin="center">

<tr id="createFolder" style="display:block;">

<td>

<input type="text" name="dirname"/>

<input type="submit" name="act" value="創建文件夾"/>

</td>

</tr>

<!--創建文件夾 -->

<tr id="createFile" style="display:block;">

<td>

<input type="text" name="filename"/>

<input type="hidden" name="path" value="<?php echo $path; ?>" />

<input type="hidden" name="act" value="createFile" />

<input type="submit" value="創建文件"/>

</td>

</tr>

<!-- 創建文件 -->

<tr>

<td>編號</td>

<td>名稱</td>

<td>類型</td>

<td>大小</td>

<td>可讀</td>

<td>可寫</td>

<td>可執行</td>

<td>創建時間</td>

<td>修改時間</td>

<td>查看時間</td>

<td>操作</td>

</tr>

<?php

if ($info['file']){

$i=1;

foreach ($info['file'] as $val){

$p=$path."/".$val;//$path下的$val,$path為目錄,$val為文件。

?>

<tr>

<td><?php echo $i;?></td>

<td><?php echo $val?></td>

<td><?php $src=filetype($p)=="file"?"file_ico.png":"folder_ico.png";?><img src="images/<?php echo $src;?>" alt="" ?title="文件"/></td>

<td><?php echo transByte(filesize($p)); ?></td>

<td><?php $src=is_readable($p)?"correct.png":"error.png";?><img src="images/<?php echo $src;?>" width="30px" height="30px" /></td>

<td><?php $src=is_writable($p)?"correct.png":"error.png";?><img src="images/<?php echo $src;?>" width="30px" height="30px" /></td>

<td><?php $src=is_executable($p)?"correct.png":"error.png";?><img src="images/<?php echo $src;?>" width="30px" height="30px" /></td>

<td><?php echo date("Y-m-d H:i:s",filectime($p));?></td>

<td><?php echo date("Y-m-d H:i:s",filemtime($p));?></td>

<td><?php echo date("Y-m-d H:i:s",fileatime($p));?></td>

</tr>

<?php

$i++;

}

}

?>

</table>

</body>

</html>


正在回答

1 回答

你檢查一下創建目錄對么?

0 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

我到這一步為什么不能echo出創建的文件?

我要回答 關注問題
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號