第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

為什么我創(chuàng)建文件提示文件創(chuàng)建失敗···,下面是代碼


<?php
error_reporting(E_ALL || ~E_NOTICE);
require_once "dir.func.php";
require_once "file.func.php";
require_once "common.func.php";
$path="file";
$info=readDirectory($path);
$act=@$_REQUEST['act'];
$filename=@$_REQUEST['filename'];
$redirect="index.php?path={$path}";
if($act=='創(chuàng)建文件'){
? ?//echo $path."--";
? ?//echo $filename;
? ?$mes=creatfile($path."/".$filename);
? ?alertmes($mes,$redirect);
}
?>

<!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">
<head>
? ?<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
? ?<title>
? ? ? ?文件管理器
? ?</title>
? ?<link rel="stylesheet" href="cikonss.css" />
? ?<script src="jquery-ui/js/jquery-1.10.2.js"></script>
? ?<script src="jquery-ui/js/jquery-ui-1.10.4.custom.js"></script>
? ?<script src="jquery-ui/js/jquery-ui-1.10.4.custom.min.js"></script>
? ?<link rel="stylesheet" href="jquery-ui/css/ui-lightness/jquery-ui-1.10.4.custom.css" ?type="text/css"/>
? ?<style type="text/css">
? ? ? ?body,p,div,ul,ol,table,dl,dd,dt{
? ? ? ? ? ?margin:0;
? ? ? ? ? ?padding: 0;
? ? ? ?}
? ? ? ?a{
? ? ? ? ? ?text-decoration: none;
? ? ? ?}
? ? ? ?ul,li{
? ? ? ? ? ?list-style: none;
? ? ? ? ? ?float: left;
? ? ? ?}
? ? ? ?#top{
? ? ? ? ? ?width:100%;
? ? ? ? ? ?height:48px;
? ? ? ? ? ?margin:0 auto;
? ? ? ? ? ?background: #E2E2E2;
? ? ? ?}
? ? ? ?#navi a{
? ? ? ? ? ?display: block;
? ? ? ? ? ?width:48px;
? ? ? ? ? ?height: 48px;
? ? ? ?}
? ? ? ?#main{
? ? ? ? ? ?margin:0 auto;
? ? ? ? ? ?border:2px solid #ABCDEF;
? ? ? ?}
? ? ? ?.small{
? ? ? ? ? ?width:25px;
? ? ? ? ? ?height:25px;
? ? ? ? ? ?border:0;
? ? ? ?}
? ?</style>
? ?<script type="text/javascript">
? ? ? ?function show(dis){
? ? ? ? ? document.getElementById(dis).style.display="block";
? ? ? ?}
? ?</script>
</head>
<body>
<div id="showDetail" ?style="display:none"><img src="" id="showImg" alt=""/></div>
<h1>慕課網(wǎng)-在線文件管理器</h1>
<div id="top">
? ?<ul id="navi">
? ? ? ?<li><a href="index.php" title="主目錄"><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-home"></span></span></a></li>
? ? ? ?<li><a href="#" ?onclick="show('createFile')" title="新建文件" ><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-file"></span></span></a></li>
? ? ? ?<li><a href="#" ?onclick="show('createFolder')" title="新建文件夾"><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-folder"></span></span></a></li>
? ? ? ?<li><a href="#" onclick="show('uploadFile')"title="上傳文件"><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-upload"></span></span></a></li>
? ? ? ?<li><a href="#" title="返回上級目錄" onclick="goBack('<?php echo $back;?>')"><span style="margin-left: 8px; margin-top: 0px; top: 4px;" class="icon icon-small icon-square"><span class="icon-arrowLeft"></span></span></a></li>
? ?</ul>
</div>
<form action="index.php" method="post" enctype="multipart/form-data">
<table width="100%" border="1" cellpadding="10" cellspacing="0" bgcolor="#6495ed" align="center";>
? ?<tr id="createFolder" ?style="display:none;">
? ? ? ?<td>請輸入文件夾名稱</td>
? ? ? ?<td >
? ? ? ? ? ?<input type="text" name="dirname" />
? ? ? ? ? ?<input type="hidden" name="path" ?value="<?php echo $path;?>"/>
? ? ? ? ? ?<input type="submit" ?name="act" ?value="創(chuàng)建文件夾"/>
? ? ? ?</td>
? ?</tr>
? ?<tr id="createFile" ?style="display:none;">
? ? ? ?<td>請輸入文件名稱</td>
? ? ? ?<td >
? ? ? ? ? ?<input type="text" ?name="filename" />
? ? ? ? ? ?<input type="hidden" name="path" value="<?php echo $path;?>"/>
? ? ? ? ? ?<input type="submit" ?name="act" value="創(chuàng)建文件" />
? ? ? ?</td>
? ?</tr>
? ?<tr id="uploadFile" style="display:none;">
? ? ? ?<td >請選擇要上傳的文件</td>
? ? ? ?<td ><input type="file" name="myFile" />
? ? ? ? ? ?<input type="submit" name="act" value="上傳文件" />
? ? ? ?</td>
? ?</tr>
? ?<tr style="color: white;text-align: center;">
? ? ? ?<td>編號</td>
? ? ? ?<td>名稱</td>
? ? ? ?<td>類型</td>
? ? ? ?<td>大小</td>
? ? ? ?<td>可讀</td>
? ? ? ?<td>可寫</td>
? ? ? ?<td>可執(zhí)行</td>
? ? ? ?<td>創(chuàng)建時間</td>
? ? ? ?<td>修改時間</td>
? ? ? ?<td>訪問時間</td>
? ? ? ?<td>操作</td>
? ?</tr>
? ?<?php
? ?if ($info['file']) {
? ? ? ?$i = 0;
? ? ? ?foreach ($info['file'] as $val) {
? ? ? ? ? ?$p = $path . '/' . $val;
? ? ? ? ? ??>
? ? ? ? ? ?<tr style="text-align: center;">
? ? ? ? ? ? ? ?<td><?php echo $i ?></td>
? ? ? ? ? ? ? ?<td><?php echo $val ?></td>
? ? ? ? ? ? ? ?<td><?php echo filetype($p)?></td>
? ? ? ? ? ? ? ?<td><?php echo transByte(filesize($p))?></td>
? ? ? ? ? ? ? ?<td><?php ?$src=is_readable($p)?"correct.png":"error.png"?><img class="small" src="images/<?php echo $src ?>" alt=""/></td>
? ? ? ? ? ? ? ?<td><?php ?$src=is_writable($p)?"correct.png":"error.png"?><img class="small" src="images/<?php echo $src ?>" alt=""/></td>
? ? ? ? ? ? ? ?<td><?php ?$src=is_executable($p)?"correct.png":"error.png"?><img class="small" src="images/<?php echo $src ?>" alt=""/></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>
? ? ? ? ? ? ? ?<td>
? ? ? ? ? ? ? ? ? ?<a href="#"><img class="small" src="images/show.png" ?alt="" title="查看"/></a>|
? ? ? ? ? ? ? ? ? ?<a href="#"><img class="small" src="images/edit.png" ?alt="" title="修改"/></a>|
? ? ? ? ? ? ? ? ? ?<a href="#"><img class="small" src="images/rename.png" ?alt="" title="重命名"/></a>|
? ? ? ? ? ? ? ? ? ?<a href="#"><img class="small" src="images/copy.png" ?alt="" title="復(fù)制"/></a>|
? ? ? ? ? ? ? ? ? ?<a href="#"><img class="small" src="images/cut.png" ?alt="" title="剪切"/></a>|
? ? ? ? ? ? ? ? ? ?<a href="#" ?><img class="small" src="images/delete.png" ?alt="" title="刪除"/></a>|
? ? ? ? ? ? ? ? ? ?<a href="#"><img class="small" ?src="images/download.png" ?alt="" title="下載"/></a>
? ? ? ? ? ? ? ?</td>
? ? ? ? ? ?</tr>
? ? ? ? ? ?<?php
? ? ? ? ? ?$i++;
? ? ? ?}
? ?}
? ??>
? ?</table>
</form>
</body>
</html>

<?php
function transByte ($size){
? ?$arr = array ("B", "KB", "MB", "GB", "TB", "EB" );
? ?$i=0;
? ?while ($size>=1024){
? ? ? ?$size/=1024;
? ? ? ?$i++;
? ?}
? ?return round($size,2).$arr[$i];
}

function creatfile($filename){
? ?$mat="/[\/,\*,<>,\?\|]/";
? ?if(!preg_match($mat,basename($filename))){
? ? ? ?if(!file_exists($filename)){
? ? ? ? ? ?if (fopen($filename)){
? ? ? ? ? ? ? ?return "文件創(chuàng)建成功";
? ? ? ? ? ?}else{
? ? ? ? ? ? ? ?return "文件創(chuàng)建失敗";
? ? ? ? ? ?}
? ? ? ?}else{
? ? ? ? ? ?return"文件已存在";
? ? ? ?}
? ?}else{
? ? ? ?return"文件名不符合要求";
? ?}
}

正在回答

1 回答

fopen需要兩個必選參數(shù)

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

為什么我創(chuàng)建文件提示文件創(chuàng)建失敗···,下面是代碼

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號