Skip to main content

Using external style sheets

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.

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

Popular posts from this blog

links

0.  https://michael67654.qowap.com/64523001/new-pos-technique-to-perk-up-your-company 1.  https://johnnydinqr.blog2learn.com/52856602/new-pos-system-to-perk-up-your-company 2.  http://edwinsqgcu.onesmablog.com/New-POS-Process-to-Perk-Up-Your-company-43309737 3.  http://chloe69246.bloguetechno.com/New-POS-Process-to-Perk-Up-Your-Business-39814721 4.  http://jacob87541.pointblog.net/New-POS-Technique-to-Perk-Up-Your-online-business-43741223 5.  http://arlette53302.thezenweb.com/New-POS-System-to-Perk-Up-Your-online-business-41464611 6.  http://devinpixna.tinyblogging.com/New-POS-Program-to-Perk-Up-Your-online-business-46354577 7.  https://rylanevsom.blog5.net/46759651/new-pos-program-to-perk-up-your-small-business 8.  https://mariowoesh.affiliatblogger.com/56515206/new-pos-system-to-perk-up-your-organization 9.  https://liam66429.diowebhost.com/60164326/new-pos-procedure-to-perk-up-your-company 10.  https://henry19219.fitnell.com/4557...

Raisonnement, la résolution de problèmes

Les chercheurs ont d'abord développé des algorithmes mimétiques raisonnement humain étapes que les gens utilisent pour résoudre le casse-tête ou faire méthode d'exclusion logique. [2] Dans les années 1980 et 1990 fin, l'étude de la grippe aviaire a développé des méthodes de traitement de l'information incertaine ou incomplète, en utilisant des concepts de probabilité et de l'économie. [3] Pour ces problèmes, les algorithmes requis matériel assez puissant pour effectuer des calculs de géant - à subir « combinaisons d'explosion »: la quantité de mémoire et le temps de calcul peut devenir invisible prendre si la résolution d'un problème difficile. La plus haute priorité est l'algorithme de recherche pour résoudre le problème.  Les gens utilisent généralement les jugements rapides et intuitifs plutôt que pas de déduction que les chercheurs en IA d'origine peuvent simuler. [5] Amnesty International a progressé en utilisant la résolution de problèmes « c...

Tracking and Securing Downloads

If you want to report or track downloads from your website, try this script.   This script will send you an email every time you have a download.   The email will tell you what file was downloaded and who did the download.   You could change this script to keep counts (store them in flat file or MySQL) if you desire. The variable $directory is the directory where the download files are located.   If you want the script in the same directory as the files then use "./" as the directory (you must always have the slash). In your html page, use the following structure as your download link (where name.txt is the file name to download): <a href="download.php?file=name.txt">download</a> Then you use the following script (called download.php): - - Start Script Here - - <?php $emailaddress  =  "email@yourdomain.com" ; $filename  =  $_GET [ 'file' ]; $directory  =  "downloads/" ; $path  =  "$directory$filename" ; putenv (...