check this link and it will make every thing clear to you with better example code:
[url]http://www.webkollage.com/php/php_uploading_files.php[/url] every thing is explain with a professional way of getting upload errors and dealing it.
then let me know.
hey check the link. about WORKING with Files in php.
FOLLOW THE LINK TO VIEW AND UNDERSTAND IN A VERY SIMPLE AND EASY WAY TO DO " PAGINATION ".