Two parts:
1) how do I upload a file to a server using PHP?
2) how do I read contents of a directory and generally look at files using PHP?

See, I've got this whole member database that I created with an enormous amount of help from people here, and I recently made it possible for people to update their information themselves, but the one thing they can't change is their pictures.

Currently the method is this: the person gives the webmaster (me, for now) a picture to use as their bio picture. I take that file, edit it to the size I want (all 200 pixels wide, any height). Then I put the file in a directory on the server. I name it using fields from that person's bio (ie: lastnamefirstname.jpg). The problem is two-fold. For one, the webmaster has to do all this, and I want the user to be able to. Two, if the user changes their name, the script that displays the picture is looking for a file based on their new name, not the old one.

Since I'm sure it's easier, simply renaming the file based on the newly entered information would solve the second problem. I don't know how to manipulate files with PHP, though. I also have no clue how to go about the first part.

Thanks in advance for the help. I tried looking for stuff like this in the online PHP manual, but it's a bit hard to decipher from that thing. What books would you all suggest?
_________________________
Matt