PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Someone above suggested php getimagesize function. It will give you all image attributes and you can extract height and width for validation. Make sure to check for file existence first otherwise getimagesize function will run forever.
I assume that after this section of code you have another section of code that copies the uploaded file from its ['tmp_name'] location to a folder within your project where it will live permanently. If that is the case you are not doing anything within this code that will stop the next section of code if the image is the wrong size.
if ( temporary file was uploaded )
{
if ( temporary file width or height is wrong )
{
then ( show error message and abort any further execution of code via exit() or return )
}
else
{
there was nothing wrong with image size so move temporary file to permanent location via move_uploaded_file()
}
}