文件夹权限和提交按钮
我想创建一个简单的安装脚本。下面是简单的代码。
<ul>
<?php
function check_perms($path,$perm)
{
clearstatcache();
$configmod = substr(sprintf('%o', fileperms($path)), -4);
$css = (($configmod != $perm) ? " class='error'" : " class='none'");
echo "<li".$css.">\n";
echo '<span style="float:left; padding-right:20px;">'.$path.'</span>';
echo '<span style="float:right; width:100px; text-align:right;"> <strong>'.$perm.'</strong></span>';
echo '<span style="float:right; padding-right:100px;"><strong>'.$configmod.'</strong></span>';
echo '<div class="clear"></div>';
echo "</li>";
}
check_perms("config.php","0777");
check_perms("themes","0777");
check_perms("themes/images","0777");
check_perms("useruploads","0777");
?>
</ul>
如何使所有文件和文件夹的权限为777有效时会出现提交按钮
。
<input type='submit' name='submit' value='Submit' />
如果仍然有不正确的权限,请不要显示“提交”按钮,
请告诉我。
I want to create a simple installation script. Below are simple code.
<ul>
<?php
function check_perms($path,$perm)
{
clearstatcache();
$configmod = substr(sprintf('%o', fileperms($path)), -4);
$css = (($configmod != $perm) ? " class='error'" : " class='none'");
echo "<li".$css.">\n";
echo '<span style="float:left; padding-right:20px;">'.$path.'</span>';
echo '<span style="float:right; width:100px; text-align:right;"> <strong>'.$perm.'</strong></span>';
echo '<span style="float:right; padding-right:100px;"><strong>'.$configmod.'</strong></span>';
echo '<div class="clear"></div>';
echo "</li>";
}
check_perms("config.php","0777");
check_perms("themes","0777");
check_perms("themes/images","0777");
check_perms("useruploads","0777");
?>
</ul>
How to make if all file and folder is valid permission to 777 will appear Submit button
.
<input type='submit' name='submit' value='Submit' />
If there still have incorrect permission do not show the Submit button
Let me know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
呃,这会有点脏,但是:
Uh, this is going to be a bit dirty, but: