if(isset($_POST['dir'])){
$set = chmod($dir, 0.$num);
if(!$set){ echo "Error setting permissions"; } else { echo "Success!"; }
} else {
echo "<form action='$PHP_SELF' method='POST'>
Enter the directory to CHMOD
<input type='text' maxlength='48' length='24' name='dir'><br>
Enter permissions: <input type='text' maxlength='3' length='5' name='num'>
</form>";
}
I just free handed this, so parse errors might be in there.
It may not be exactly what you need, but it is a good start.