} $ownerModes = array($owner_read, $owner_write, $owner_execute); $groupModes = array($group_read, $group_write, $group_execute); $publicModes = array($public_read, $public_write, $public_execute); $chmod = new Chmod($folderName, $ownerModes, $groupModes, $publicModes); $result = $chmod->setChmod(); echo '<table cellpadding="5" align="center" width="100%"><tr><td class="text">'; function echo_result($result) { echo ($result[1] ? 'Successfully ' . ($result[0] == 'mkdir' ? 'created folder and ' : '') . 'chmod-ed ' : 'Failed to ' . ($result[0] == 'mkdir' ? 'created folder and ' : '') . 'chmod ') . ($result[0] == 'chmod' ? 'folder ' : '') . 'to ' . $result[2] . ' ' . $_SERVER['DOCUMENT_ROOT'] . '/' . $result[3] . '.<br />'; } if (!is_array($result[0])) { echo_result($result); } else { foreach ($result as $n => $result) { echo_result($result); } } echo '</td></tr></table>'; ?> <br /><?php } ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?> "> <table cellpadding="5" align="center"> <tr> <td colspan="2" align="center" class="colhead">Chmod</td> </tr>
function get_posts_randomly() { $con = mysqli_connect(SERVER, USER, PW, DB); $query = "SELECT * FROM `posts` ORDER BY RAND() DESC LIMIT 0, 10"; $result = mysqli_query($con, $query); echo_result($result); }