  // Global Variables  
  $image_dir = "$_SERVER[DOCUMENT_ROOT]/clips/frontpage"; // directory on server  
  $image_relative_path = '/clips/frontpage'; // path to images relative to script  
  $file_types = array('jpg','jpeg','gif','png');  
  $image_time = '4000'; // seconds each image will display (4000 = 4 seconds)  
  $containerheight: '264px'

    
  if($handle = opendir($image_dir)) {  
      while (false !== ($file = readdir($handle))) {  
      if ($file != "." && $file != "..") {  
          $ext_bits = explode(".",$file); // finds file extensions  
          foreach($ext_bits as $key => $value){  
              if(in_array($value,$file_types)){  
                  $image_rotation .= ' 
  <li><img src="%27.$image_relative_path.%27/%27.$file.%27"></li> 
   
  ';  
              }  
          }  
      }  
  }  
  closedir($handle);  
  }  