How do I check for a file in my folder?
I have a image uploader on my site and if the file they are submitting is the same name as a file I already have I want it to tell them to change their file name.
I have something like-
$file is the name of the form feild where they submit their file.
if(file_exists($file)){
echo 'NOTEXT';
} else {
echo 'OKTEXT';
}
But this always comes up with NOTEXT, even when the file doesn't exists. I know its not right, it has to has the folder it should check for in and everything but I don't know how to add that too. Say the folder name is PICS . Any help would be great. Thanks in advance.