Salkcin wrote:You can also check it by using the file_exists() function
Except that now you're introducing some ambiguity - what if there's a file called "userfiles" but no directory with this name?
As Drakla pointed out, the crux of your problem is a missing closing brace (or you can omit the opening brace, since you only have ONE statement inside the conditionals, though I've learned that omitting braces isn't always recommended). For a coding example of the different control structures, visit this man page: [man]if[/man] (more specifically, this one will show you what your code should look like: [man]else[/man]).