You are correct Sir! It was a simple path problem. Won't make that mistake again.
So I'm going through the array to either delete the file if it has no extension, or run the rest of the script to process the image file. How do I exempt the directory itself and it's parent directory from scrutiny? Here is the code I'm using right now:
$filenames = scandir($dir);
foreach($filenames as $name){
if (!strpos($name,".")){
unlink ("images/gmail/".$name);
}else{
I know there's a way to do it, I just have yet to find it.
And thanks for the friendly welcome. Looks like I'll be spending a bit of time here.