Php -> image upload problem

while learning PHP i started to build a cms sytem for my flash website.
after a lot of trying, de-bugging and so on i finished my news item with uploading images.
That works fine. After that i thought it would be helpfull if an uploaded image resizing itself to 50x50 pixels. So i looked at php.net and in google for a good script. I found a couple but because my php knowlegde is in some ways still like a beginner.

i have this function for uploading the images:



function afbUpload ($file, $fileName)
	{
		if (is_uploaded_file ($file["tmp_name"] ) )
		{
			if (move_uploaded_file ($file["tmp_name"], "/var/www/vhosts/it-bone.nl/httpdocs/include/images/nieuws/" . $fileName . ".jpg" ) )
			{
				return true;
			}
			else
			{
				return false;
			}
		}
	}


now i try to look for a code to change the size to 50x50 pixels but i don’t know where to start and where to add the code. Does someone can give me a hint or help me reaching my goal.

Kind regards Jos:ninja: :crazy: :stare: