The following snippet lists all files and subdirectories in the specified directory. For the files it lists the file size as well. It uses the following functions: opendir, readdir, is_dir, filesize. All the functions are available in PHP4 and PHP5 so the code runs without any problem on PHP4+.
Here is a simple php snippet to upload files from the local server to a remote location:
Here is the content of the php file that will be served by as an image. The header function will inform the browser that it will receive a png image. The image will be available as http://mysitecom/button.php?text=Download
Here is a little snippet to resize an image in php. You need to have the GD library installed to use it, but most of the hosting providers have it activated by default: