To use an external style sheet, most CSS tutorials will tell you to put the following in the <head> section of your html:
<link rel="stylesheet" type="text/css" href="style.css">
DO NOT use that technique. Instead use this:
<style type="text/css">
@import url(style.css);
</style>
That will allow you to put more CSS that may be unique to that page under the @import and have all your CSS in one place. You can also override some CSS in the same fashion, since the last CSS encountered is what is used. This technique provides much more flexibility.
In Windows Explorer, make sure you have the address bar visible - View/Toobars/Address Bar. Then in the address bar at the top put in:
ftp://user:password@ftpserver.com
Then you will see your FTP server root listed in the left pane just like any other drive on your PC.
To chmod a file you can just right click the file, select properties, and make the changes
This script can be very helpful if you have multiple ftp users and you want to monitor file or directory sizes.
Put the script below into a file called space.php.
- - Start Script Here - -
- - End Script Here - -
<link rel="stylesheet" type="text/css" href="style.css">
DO NOT use that technique. Instead use this:
<style type="text/css">
@import url(style.css);
</style>
That will allow you to put more CSS that may be unique to that page under the @import and have all your CSS in one place. You can also override some CSS in the same fashion, since the last CSS encountered is what is used. This technique provides much more flexibility.
FTP made easy
The easy way to FTP is to just use Windows Explorer (the same one you use on your PC to look at files on your hard drive) - NOT Internet Explorer. Then you will see your FTP server listed just like any other drive. You can drag and drop files and/or delete folders/files. You can also do a quick chmod with a right click on a file and select properties.In Windows Explorer, make sure you have the address bar visible - View/Toobars/Address Bar. Then in the address bar at the top put in:
ftp://user:password@ftpserver.com
Then you will see your FTP server root listed in the left pane just like any other drive on your PC.
To chmod a file you can just right click the file, select properties, and make the changes
Find File and Directory Sizes
This php script will search any directory (and all subdirectories under that directory). It will show you the total size of the directory, number of files in the directory, and identify any files > or = to the size specified. When you run this script you will be prompted for the unix directory name and the test file size parameter.This script can be very helpful if you have multiple ftp users and you want to monitor file or directory sizes.
Put the script below into a file called space.php.
- - Start Script Here - -
<?phpif ($_POST['submit'] ) { $dir = $_POST['dir'];$test_size = $_POST['size'];// get info functionfunction getInfo($dir) {
global $size;
global $max_size;
global $loop_result;
global $count;
$dh = opendir($dir);
while (($file = readdir($dh)) !== false) {
if ($file != "." and $file != "..") {
$path = $dir."/".$file;
if (is_file($path)) {
$size += filesize($path);
$count++;
if (filesize($path) >= $max_size) {
$print_size = sizeConv(filesize($path));
$loop_result .="$file $print_size<br>";
}
} else {
if (is_dir($path)) getInfo($path);
}
}
}
closedir($dh);
return;
}// size conversion functionfunction sizeConv($size) {
switch ($size) {
case ($size>=1000000): $size = round($size/1000000) . " MB"; break;
case ($size>=1000); $size = round($size/1000) . " KB"; break;
default: $size = $size . " bytes"; break;
}
return $size;
}// processing mainlineif (file_exists($dir)) {
$size = 0; $count = 0; $loop_result = "";
$max_size = $test_size * 1000;
getInfo($dir);
$message .= "<b>Statistics for directory $dir</b><br><br>";
$display_size = sizeConv($size);
$message .="Disk space utilization = $display_size<br>";
$max_size = $test_size * 1000;
$print_size = sizeconv($max_size);
$message .= "Total file count = $count<br>";
if ($loop_result) {
$message .="<br><b>List of files > or = $print_size:</b><br>";
} else {
$loop_result .="No files found > $print_size";
}
$message .= $loop_result;
} else {
$message .= "Directory <b>$dir</b> does not exist, please re-enter a vaild directory path.";
}// outputecho "$message<br><hr>";
}$path ="put_your_root_path_here";// input form?><form action="space.php" method="post" name="inputform">
<b>For a specific directory and all subdirectories, determine:<br>1) total space used<br>2) number of files<br>3) all files > or = a certain size</b><br>
<br>Directory <input type=text value="<?=$path?>" name="dir" size="50">
<br>Size (in KB) <input type=text value="200" name="size" size="6">
<br><input type="submit" name="submit" value="Submit">
</form>- - End Script Here - -
Comments
Post a Comment