<?
	$pathToImgs =  ( $HTTP_POST_VARS['pathToImgs'] );
	
	$handle = opendir($pathToImgs);
	//$handle = opendir('images');

	while (false !== ($file = readdir($handle))) { 
		if ($file != "." && $file != ".." && $file != "filenames.php" && $file != "index.html") {
			$fileNames.=$file.",";
		}
	}
	$fileNames = substr($fileNames, 0, -1);    
	closedir($handle);
	echo "&fileNames=$fileNames";
?>