TomBower
06-20-2010, 10:39 AM
<table width="100%" border="0" cellpadding="3" style="text-align:center;">
<tr>
<th style="border:0px;"><b>File Name</b></th>
<th style="border:0px;"><b>Required Chmod</b></th>
<th style="border:0px;"><b>Current Chmod</b></th>
</tr>
<?php
function check_perms($path,$perm)
{
clearstatcache();
$configmod = substr(sprintf('%o', fileperms($path)), -4);
$trcss = (($configmod != $perm) ? "background-color:#fd7a7a;" : "background-color:#91f587;");
echo "<tr style=".$trcss.">";
echo "<td style=\"border:0px;\">". $path ."</td>";
echo "<td style=\"border:0px;\">$perm</td>";
echo "<td style=\"border:0px;\">$configmod</td>";
echo "</tr>";
}
check_perms("img","777");
check_perms("config.php","777");
check_perms("cache","777");
?>
</table>
<p><br />
<a class="button" href="requirements.php">Proceed to 'MySQL Configuration'</a><br />
How could I make it so that the 'Proceed' button only appears if the perms are correct and if they aren't, show a 'recheck' button?
Thankyou for your time taken to read this.
<tr>
<th style="border:0px;"><b>File Name</b></th>
<th style="border:0px;"><b>Required Chmod</b></th>
<th style="border:0px;"><b>Current Chmod</b></th>
</tr>
<?php
function check_perms($path,$perm)
{
clearstatcache();
$configmod = substr(sprintf('%o', fileperms($path)), -4);
$trcss = (($configmod != $perm) ? "background-color:#fd7a7a;" : "background-color:#91f587;");
echo "<tr style=".$trcss.">";
echo "<td style=\"border:0px;\">". $path ."</td>";
echo "<td style=\"border:0px;\">$perm</td>";
echo "<td style=\"border:0px;\">$configmod</td>";
echo "</tr>";
}
check_perms("img","777");
check_perms("config.php","777");
check_perms("cache","777");
?>
</table>
<p><br />
<a class="button" href="requirements.php">Proceed to 'MySQL Configuration'</a><br />
How could I make it so that the 'Proceed' button only appears if the perms are correct and if they aren't, show a 'recheck' button?
Thankyou for your time taken to read this.