Thanks for your help, Dave! And thanks for the responses, Ruben.

A little additional work was needed to make the directory tests succeed, though. I had to change the permissions on the file "test.file" in each directory to 777 (from 644) for the tests to pass.

However, my original problem remains: users cannot upload new avatar images.

I thought it was working after Dave's fix, but additional testing proved otherwise. It turns out that if the user tries to upload an image that's already on the server, his avatar image changes to the new image. But if you try to upload a totally new image, an error message briefly flashes on the screen:

Warning: copy(/home/---/domains/---.infopop.cc/public_html/threads/gallery/2.jpg) [function.copy]:failed to open stream: Permission denied in /home/---/domains/---.infopop.cc/public_html/threads/changebasic.php on line 246

Any more ideas?