Code: Select all
<?php
/* Set the full path to start scanning from. If left blank, it will run from the current directory */
$dir = "/Volumes/ACC-E-STUDENTS/"; /*All student folders are in this directory*/
$name = $_POST["name"]; /*This line gets the user name inputted on the html page. Ex. miliac45*/
$all = $dir . $name; /*This line joins the two previous lines together. Ex. /Volumes/ACC-E-STUDENTS/miliac45*/
/* Run du to get directory sizes */
$tmp2 = exec("du -mh $all",$arr_return,$return); /*This line doesn't return any output. I think that it is due to my concatenation of $dir and $name into $all. If I change $dir to the whole directory, it works o.k. */
?>
<html>
<head>
<title>Folder Sizes</title>
<style type="text/css"></style>
</head>
<body>
DIR :<?php echo $dir; ?><br>/* Echos dir perfectly*/
Name :<?php echo $name; ?><br>/* Echos name perfectly*/
All :<?php echo $all; ?><br>/* Echos all perfectly.*/
Calc:<?php echo $tmp2; ?><br> /*Nothing*/
</body>
</html>
Please Help!!!!