help20
پنج شنبه 02 خرداد 1392, 03:41 صبح
سلام دوستان خسته نباشید
این کد رو میشه بگین چرا خطا میده؟!!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>دایرکتوری مورد نظر</title>
<style>
*{
padding:0;
margin:0;
}
html,body {
color:#333;
font-family: "Tahoma";
font-size:11px;
direction:rtl;
text-shadow:1px 1px 1px #cacaca;
-webkit-text-shadow:1px 1px 1px #cacaca;
-moz-text-shadow:1px 1px 1px #cacaca;
}
a{
padding: 2px 0 0 24px;
color:#3780b3;
text-decoration:none;
}
a:hover{
color:#000;
}
#container{
margin:0 auto;
width:800px;
margin-top:20px;
padding-top:10px;
border:1px solid #EEE;
border-radius:10px;
-moz-border-radius:10px;
}
.head{
background-color:#6ca607;
color:#FFF;
padding:7px 0 5px 10px;
font-size:11px;
letter-spacing:1px;
font-family: Tahoma;
}
.head:hover{background-color:#FE4902;}
.head span{font-size:9px; letter-spacing:0;}
td{
background-color:#F3F3F3;
padding:6px;
}
td:hover{background-color:#EFEFEF;}
h1{
font-size:12px;
padding:0 0 10px 10px;
}
</style>
</head>
<body>
<?php
$myDirectory = opendir("image");
while($entryName = readdir($myDirectory)) {
$dirArray[] = $entryName;
}
function frmtindex ($filename)
{
$filename = strtolower($filename) ;
$exts = split("[/\\.]", $filename) ;
$n = count($exts)-1;
$exts = $exts[$n];
return $exts;
}
closedir($myDirectory);
$indexCount = count($dirArray);
sort($dirArray);
print("<h1>محتوای دایرکتوری</h1>");
print("<table width='100%' cellspacing='10'>
<tr>
<td width='70%' class='head'>نام فایل</td>
<td width='10%' class='head'>فرمت</td>
<td width='15%' class='head'>اندازه</td>
<td width='15%' class='head'>تاریخ</td>
<td width='5%' class='head'>حذف</td></tr>\n");
for($index=0; $index < $indexCount; $index++) {
if (substr("$dirArray[$index]", 0, 1) != "."){ // don't list hidden files
print("<tr><td><a target='_blank' href='$dirArray[$index]'>$dirArray[$index]</a></td>");
print("<td>");
print(frmtindex($dirArray[$index]));
print("</td>");
print("<td>");
print(round(filesize($dirArray[$index]) / 1024, 2));
print("</td>");
print("<td>");
print(date("D j M G:i:s", filemtime($dirArray[$index])));
print("</td>");
print("<td>
<form action='directory.php' method='post'>
<input style='display:none' type='text' value='$dirArray[$index]' name='filename'></br>
<input type='Submit' style='font-size:11px;font-family:tahoma;' name='delfile' value='حذف'>
</form>
</td>");
print("</tr>\n");
}
}
print("</table>\n");
?>
</body>
</html>
این کد رو میشه بگین چرا خطا میده؟!!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>دایرکتوری مورد نظر</title>
<style>
*{
padding:0;
margin:0;
}
html,body {
color:#333;
font-family: "Tahoma";
font-size:11px;
direction:rtl;
text-shadow:1px 1px 1px #cacaca;
-webkit-text-shadow:1px 1px 1px #cacaca;
-moz-text-shadow:1px 1px 1px #cacaca;
}
a{
padding: 2px 0 0 24px;
color:#3780b3;
text-decoration:none;
}
a:hover{
color:#000;
}
#container{
margin:0 auto;
width:800px;
margin-top:20px;
padding-top:10px;
border:1px solid #EEE;
border-radius:10px;
-moz-border-radius:10px;
}
.head{
background-color:#6ca607;
color:#FFF;
padding:7px 0 5px 10px;
font-size:11px;
letter-spacing:1px;
font-family: Tahoma;
}
.head:hover{background-color:#FE4902;}
.head span{font-size:9px; letter-spacing:0;}
td{
background-color:#F3F3F3;
padding:6px;
}
td:hover{background-color:#EFEFEF;}
h1{
font-size:12px;
padding:0 0 10px 10px;
}
</style>
</head>
<body>
<?php
$myDirectory = opendir("image");
while($entryName = readdir($myDirectory)) {
$dirArray[] = $entryName;
}
function frmtindex ($filename)
{
$filename = strtolower($filename) ;
$exts = split("[/\\.]", $filename) ;
$n = count($exts)-1;
$exts = $exts[$n];
return $exts;
}
closedir($myDirectory);
$indexCount = count($dirArray);
sort($dirArray);
print("<h1>محتوای دایرکتوری</h1>");
print("<table width='100%' cellspacing='10'>
<tr>
<td width='70%' class='head'>نام فایل</td>
<td width='10%' class='head'>فرمت</td>
<td width='15%' class='head'>اندازه</td>
<td width='15%' class='head'>تاریخ</td>
<td width='5%' class='head'>حذف</td></tr>\n");
for($index=0; $index < $indexCount; $index++) {
if (substr("$dirArray[$index]", 0, 1) != "."){ // don't list hidden files
print("<tr><td><a target='_blank' href='$dirArray[$index]'>$dirArray[$index]</a></td>");
print("<td>");
print(frmtindex($dirArray[$index]));
print("</td>");
print("<td>");
print(round(filesize($dirArray[$index]) / 1024, 2));
print("</td>");
print("<td>");
print(date("D j M G:i:s", filemtime($dirArray[$index])));
print("</td>");
print("<td>
<form action='directory.php' method='post'>
<input style='display:none' type='text' value='$dirArray[$index]' name='filename'></br>
<input type='Submit' style='font-size:11px;font-family:tahoma;' name='delfile' value='حذف'>
</form>
</td>");
print("</tr>\n");
}
}
print("</table>\n");
?>
</body>
</html>