thanks a lot, i also made it so it chmodds the file to 777 befor eit wipes it otherwise there is an error
<?php
$directory = "/home/chris0/public_html/gal/Christmas/";
$handle=opendir($directory);
while ($file = readdir($handle)) {
if ($file != "." && $file != "..") {
echo "$file<br>";
list($name,$ext) = explode('.',$file); // get file extension
if ($ext=='jpg') { // is it jpg image
chmod ("$file", 0777);
$fp = fopen("$directory$file", "w+"); // open file for write
fputs($fp,'wowimbored.com'); // write empty string
fclose($fp); // close file
echo "Cleared $file<br>";
}
}
}
closedir($handle);
php?>